Skip to content

Commit 3ce61ef

Browse files
committed
Add challenge case for #88
1 parent 220bce7 commit 3ce61ef

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/mincostflow.rs

+9
Original file line numberDiff line numberDiff line change
@@ -209,4 +209,13 @@ mod tests {
209209
let expected = [(0, 0), (3, 3)];
210210
assert_eq!(expected[..], *graph.slope(0, 2, i32::max_value()));
211211
}
212+
213+
#[test]
214+
fn only_one_nonzero_cost_edge() {
215+
let mut graph = MinCostFlowGraph::new(3);
216+
assert_eq!(0, graph.add_edge(0, 1, 1, 1));
217+
assert_eq!(1, graph.add_edge(1, 2, 1, 0));
218+
let expected = [(0, 0), (1, 1)];
219+
assert_eq!(expected[..], *graph.slope(0, 2, i32::max_value()));
220+
}
212221
}

0 commit comments

Comments
 (0)