Skip to content

Commit 728c62e

Browse files
committed
ignore crosscheck_olpc_cjson
When the encode! macro is expended, it end up using olpc_cjson::CanonicalFormatter instead of crate::CanonicalFormatter olpc_cjson doesn't escape control char, so test is broken. Also add crosscheck_cjson, this one fails because of ordering differences. Signed-off-by: Etienne Champetier <[email protected]>
1 parent d58fab4 commit 728c62e

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ cap-std = "3.4.4"
2020
sha2 = "0.10.9"
2121
# For cross-integration testing
2222
olpc-cjson = "0.1"
23+
cjson = "0.1.2"

src/lib.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -690,15 +690,22 @@ mod tests {
690690

691691
proptest! {
692692
#[test]
693+
#[ignore = "broken (control char)"]
693694
fn crosscheck_olpc_cjson(v in arbitrary_json()) {
694-
use olpc_cjson::CanonicalFormatter;
695-
696695
let mut olpc_cjson_serialized = Vec::new();
697-
let mut ser = serde_json::Serializer::with_formatter(&mut olpc_cjson_serialized, CanonicalFormatter::new());
696+
let mut ser = serde_json::Serializer::with_formatter(&mut olpc_cjson_serialized, olpc_cjson::CanonicalFormatter::new());
698697
prop_assume!(v.serialize(&mut ser).is_ok());
699698

700699
let buf = encode!(&v).unwrap();
701700
assert_eq!(buf, olpc_cjson_serialized);
702701
}
703702
}
703+
704+
proptest! {
705+
#[test]
706+
#[ignore = "broken (ordering)"]
707+
fn crosscheck_cjson(v in arbitrary_json()) {
708+
assert_eq!(v.to_canon_json_vec().unwrap(), cjson::to_vec(&v).unwrap());
709+
}
710+
}
704711
}

0 commit comments

Comments
 (0)