2 // Test that the precedence of ranges is correct
11 fn bar(&self) -> usize { 5 }
16 assert_eq!(x, (4..9));
19 assert_eq!(x, (1..9));
22 assert_eq!(x, (4..4));
24 let a = Foo { foo: 3 };
25 let x = a.foo..a.bar();
26 assert_eq!(x, (3..5));
33 let a = &[0, 1, 2, 3, 4, 5, 6];
35 assert_eq!(x, &a[2..4]);
37 assert_eq!(x, &a[..3]);
39 assert_eq!(x, &a[3..]);
41 for _i in 2+4..10-3 {}
45 for _ in 1.. { break; }
48 assert_eq!(x, (([1])..([2])));