Skip to content

Commit aa469a9

Browse files
committed
add final test case, correct one of the others (both versions produced
same result)
1 parent 2a25876 commit aa469a9

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

src/librustc_data_structures/transitive_relation.rs

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,14 +535,32 @@ fn mubs_scc_3() {
535535
let mut relation = TransitiveRelation::new();
536536
relation.add("a", "c");
537537
relation.add("c", "d");
538-
relation.add("e", "e");
538+
relation.add("d", "e");
539539
relation.add("e", "c");
540540
relation.add("b", "d");
541541
relation.add("b", "e");
542542

543543
assert_eq!(relation.minimal_upper_bounds(&"a", &"b"), vec![&"c"]);
544544
}
545545

546-
/*
547-
"digraph { a -> c -> d -> e -> c; a -> d; b -> e; }"
548-
*/
546+
#[test]
547+
fn mubs_scc_4() {
548+
// +---------+
549+
// v |
550+
// a -> c -> d -> e
551+
// | ^ ^
552+
// +---------+ |
553+
// |
554+
// b ---+
555+
556+
// "digraph { a -> c -> d -> e -> c; a -> d; b -> e; }"
557+
let mut relation = TransitiveRelation::new();
558+
relation.add("a", "c");
559+
relation.add("c", "d");
560+
relation.add("d", "e");
561+
relation.add("e", "c");
562+
relation.add("a", "d");
563+
relation.add("b", "e");
564+
565+
assert_eq!(relation.minimal_upper_bounds(&"a", &"b"), vec![&"c"]);
566+
}

0 commit comments

Comments
 (0)