Skip to content

Commit 927e7f7

Browse files
authored
Update all_test.rs
1 parent 6fa2965 commit 927e7f7

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

rust/tests/all_test.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,18 @@ fn shorten_recovery_test() {
7777
let lat = cols[1].parse::<f64>().unwrap();
7878
let lng = cols[2].parse::<f64>().unwrap();
7979
let short_code = cols[3];
80-
81-
assert_eq!(shorten(full_code, Point::new(lng, lat)).unwrap(), short_code, "shorten");
82-
assert_eq!(
83-
recover_nearest(short_code, Point::new(lng, lat)),
84-
Ok(full_code.to_string()),
85-
"recover"
86-
);
80+
let test_type = cols[4];
81+
82+
if test_type == 'B' || test_type == 'S' {
83+
assert_eq!(shorten(full_code, Point::new(lng, lat)).unwrap(), short_code, "shorten");
84+
}
85+
if test_type == 'B' || test_type == 'R' {
86+
assert_eq!(
87+
recover_nearest(short_code, Point::new(lng, lat)),
88+
Ok(full_code.to_string()),
89+
"recover"
90+
);
91+
}
8792

8893
tested += 1;
8994
}

0 commit comments

Comments
 (0)