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 2
2
refs/heads/master: 09bb07bed9166105ea961a42b5fff7739ae0d2e9
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5
- refs/heads/try: 254a86e49edb0fbf38d335a50b1ab535fa7fd757
5
+ refs/heads/try: e0a9d41b04f16b7771315dcbfcb4e1fa4c347c33
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
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