Skip to content

Commit 8ac8d5e

Browse files
committed
rust: JSON reformatting for unit tests
Strangely very old tests started not to pass anymore as JSON content is tested for equality but JSON fields order not being guaranteed in any way two tests were failing. Using the Rust output as expected input (only the formatting indeed not the values) for the tests to pass again. Signed-off-by: Nicolas Buffon <nicolas.buffon@orange.com>
1 parent e32be18 commit 8ac8d5e

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

rust/src/exchange.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -559,18 +559,18 @@ mod tests {
559559
"perceived_object_container": [{
560560
"object_id": 0,
561561
"time_of_measurement": 50,
562+
"x_distance": 400,
563+
"y_distance": 100,
564+
"x_speed": 1400,
565+
"y_speed": 500,
566+
"object_age": 1500,
562567
"confidence": {
563568
"x_distance": 102,
564569
"y_distance": 102,
565570
"x_speed": 127,
566571
"y_speed": 127,
567572
"object": 10
568-
},
569-
"x_distance": 400,
570-
"y_distance": 100,
571-
"x_speed": 1400,
572-
"y_speed": 500,
573-
"object_age": 1500
573+
}
574574
}]
575575
}
576576
}"#
@@ -647,20 +647,20 @@ mod tests {
647647
"perceived_object_container": [{
648648
"object_id": 0,
649649
"time_of_measurement": 50,
650-
"confidence": {
651-
"x_distance": 102,
652-
"y_distance": 102,
653-
"x_speed": 7,
654-
"y_speed": 7,
655-
"object": 10
656-
},
657650
"x_distance": 400,
658651
"y_distance": 100,
659652
"z_distance": 50,
660653
"x_speed": 1400,
661654
"y_speed": 500,
662655
"z_speed": 0,
663656
"object_age": 1500,
657+
"confidence": {
658+
"x_distance": 102,
659+
"y_distance": 102,
660+
"x_speed": 7,
661+
"y_speed": 7,
662+
"object": 10
663+
},
664664
"object_ref_point": 8,
665665
"x_acceleration": -160,
666666
"y_acceleration": 0,

0 commit comments

Comments
 (0)