File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 254a86e49edb0fbf38d335a50b1ab535fa7fd757
2
+ refs/heads/master: e0a9d41b04f16b7771315dcbfcb4e1fa4c347c33
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5
5
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
Original file line number Diff line number Diff line change @@ -1046,6 +1046,25 @@ mod test_tim_sort {
1046
1046
tim_sort ( arr) ;
1047
1047
fail ~"Guarantee the fail";
1048
1048
}
1049
+
1050
+ struct DVal { val : ~uint }
1051
+ impl DVal : Ord {
1052
+ pure fn lt ( _x : & DVal ) -> bool { true }
1053
+ pure fn le ( _x : & DVal ) -> bool { true }
1054
+ pure fn gt ( _x : & DVal ) -> bool { true }
1055
+ pure fn ge ( _x : & DVal ) -> bool { true }
1056
+ }
1057
+
1058
+ #[ test]
1059
+ fn test_bad_Ord_impl ( ) {
1060
+ let rng = rand:: Rng ( ) ;
1061
+ let mut arr = do vec:: from_fn ( 500 ) |_i| {
1062
+ let randVal = rng. gen_uint ( ) ;
1063
+ DVal { val : ~randVal }
1064
+ } ;
1065
+
1066
+ tim_sort ( arr) ;
1067
+ }
1049
1068
}
1050
1069
1051
1070
#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments