File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed
src/librustc_data_structures Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -535,14 +535,32 @@ fn mubs_scc_3() {
535
535
let mut relation = TransitiveRelation :: new ( ) ;
536
536
relation. add ( "a" , "c" ) ;
537
537
relation. add ( "c" , "d" ) ;
538
- relation. add ( "e " , "e" ) ;
538
+ relation. add ( "d " , "e" ) ;
539
539
relation. add ( "e" , "c" ) ;
540
540
relation. add ( "b" , "d" ) ;
541
541
relation. add ( "b" , "e" ) ;
542
542
543
543
assert_eq ! ( relation. minimal_upper_bounds( & "a" , & "b" ) , vec![ & "c" ] ) ;
544
544
}
545
545
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
+ }
You can’t perform that action at this time.
0 commit comments