blob: 71c9e63e1a2486088a7690ec511dfddfb8eee8f8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
extern crate toml;
extern crate serde;
use serde::ser::Serialize;
const example: &str = "\
[example]
text = '''
this is the first line
this is the second line
'''
";
#[test]
fn test_pretty() {
let value: toml::Value = toml::from_str(example).unwrap();
let mut result = String::with_capacity(128);
value.serialize(&mut toml::Serializer::pretty(&mut result)).unwrap();
assert_eq!(example, &result);
}
|