You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 1. a hard-coded serialization demonstrating the format at time of initial release can still
600
+
// be deserialized to a ChaChaRng
601
+
// 2. re-serializing the resultant object produces exactly the original string
602
+
//
603
+
// Condition 2 is stronger than necessary: an equivalent serialization (e.g. with field order
604
+
// permuted, or whitespace differences) would also be admissible, but would fail this test.
605
+
// However testing for equivalence of serialized data is difficult, and there shouldn't be any
606
+
// reason we need to violate the stronger-than-needed condition, e.g. by changing the field
607
+
// definition order.
608
+
#[cfg(feature = "serde")]
609
+
#[test]
610
+
fntest_chacha_serde_format_stability(){
611
+
let j = r#"{"seed":[4,8,15,16,23,42,4,8,15,16,23,42,4,8,15,16,23,42,4,8,15,16,23,42,4,8,15,16,23,42,4,8],"stream":27182818284,"word_pos":314159265359}"#;
612
+
let r:ChaChaRng = serde_json::from_str(j).unwrap();
0 commit comments