Skip to content

Commit 4b0747b

Browse files
committed
Changed the test code
1 parent cac3df7 commit 4b0747b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/twosat.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,14 @@ mod tests {
7373
res.push(y[i]);
7474
}
7575
}
76-
assert_eq!(res, [4, 2, 0]);
76+
77+
//Check the min distance between flags
78+
res.sort();
79+
let mut min_distance = i32::max_value();
80+
for i in 1..res.len() {
81+
min_distance = std::cmp::min(min_distance, res[i] - res[i - 1]);
82+
}
83+
assert!(min_distance >= d);
7784
}
7885

7986
#[test]

0 commit comments

Comments
 (0)