1
use ron::ser::{to_string_pretty, PrettyConfig};
2

            
3
#[test]
4
4
fn small_array() {
5
4
    let arr = &[(), (), ()][..];
6
4
    assert_eq!(
7
4
        to_string_pretty(&arr, PrettyConfig::new().new_line("\n")).unwrap(),
8
        "[
9
    (),
10
    (),
11
    (),
12
]"
13
    );
14
4
    assert_eq!(
15
4
        to_string_pretty(
16
4
            &arr,
17
4
            PrettyConfig::new().new_line("\n").compact_arrays(true)
18
        )
19
4
        .unwrap(),
20
        "[(), (), ()]"
21
    );
22
4
    assert_eq!(
23
4
        to_string_pretty(
24
4
            &arr,
25
4
            PrettyConfig::new()
26
4
                .new_line("\n")
27
4
                .compact_arrays(true)
28
4
                .separator("")
29
        )
30
4
        .unwrap(),
31
        "[(),(),()]"
32
    );
33
4
    assert_eq!(
34
4
        to_string_pretty(
35
4
            &vec![(1, 2), (3, 4)],
36
4
            PrettyConfig::new()
37
4
                .new_line("\n")
38
4
                .separate_tuple_members(true)
39
4
                .compact_arrays(true)
40
        )
41
4
        .unwrap(),
42
        "[(
43
    1,
44
    2,
45
), (
46
    3,
47
    4,
48
)]"
49
    );
50
4
}