Fix json test.
This commit is contained in:
parent
54a8d69c4f
commit
11871b8baa
1 changed files with 7 additions and 9 deletions
|
@ -703,20 +703,18 @@ mod tests {
|
||||||
assert to_str(mk_dict(~[])) == ~"{}";
|
assert to_str(mk_dict(~[])) == ~"{}";
|
||||||
assert to_str(mk_dict(~[(~"a", Boolean(true))]))
|
assert to_str(mk_dict(~[(~"a", Boolean(true))]))
|
||||||
== ~"{ \"a\": true }";
|
== ~"{ \"a\": true }";
|
||||||
assert to_str(mk_dict(~[
|
let a = mk_dict(~[
|
||||||
(~"a", Boolean(true)),
|
(~"a", Boolean(true)),
|
||||||
(~"b", List(@~[
|
(~"b", List(@~[
|
||||||
mk_dict(~[(~"c", String(@~"\x0c\r"))]),
|
mk_dict(~[(~"c", String(@~"\x0c\r"))]),
|
||||||
mk_dict(~[(~"d", String(@~""))])
|
mk_dict(~[(~"d", String(@~""))])
|
||||||
]))
|
]))
|
||||||
])) ==
|
]);
|
||||||
~"{ " +
|
let astr = to_str(a);
|
||||||
~"\"a\": true, " +
|
let b = result::get(from_str(astr));
|
||||||
~"\"b\": [" +
|
let bstr = to_str(b);
|
||||||
~"{ \"c\": \"\\f\\r\" }, " +
|
assert astr == bstr;
|
||||||
~"{ \"d\": \"\" }" +
|
assert a == b;
|
||||||
~"]" +
|
|
||||||
~" }";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue