Skip to content

Commit b8efaa6

Browse files
committed
Add dedicated testcase for #15881
Also enable an ignored test case, closes #15881
1 parent 583c5c5 commit b8efaa6

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
//
11+
// regression test for the model lexer handling the DOTDOTDOT syntax (#15877)
12+
13+
pub fn main() {
14+
match 5u {
15+
1u...5u => {}
16+
_ => panic!("should match range"),
17+
}
18+
match 5u {
19+
6u...7u => panic!("shouldn't match range"),
20+
_ => {}
21+
}
22+
match 5u {
23+
1u => panic!("should match non-first range"),
24+
2u...6u => {}
25+
_ => panic!("math is broken")
26+
}
27+
match 'c' {
28+
'a'...'z' => {}
29+
_ => panic!("should suppport char ranges")
30+
}
31+
match -3i {
32+
-7...5 => {}
33+
_ => panic!("should match signed range")
34+
}
35+
match 3.0f64 {
36+
1.0...5.0 => {}
37+
_ => panic!("should match float range")
38+
}
39+
match -1.5f64 {
40+
-3.6...3.6 => {}
41+
_ => panic!("should match negative float range")
42+
}
43+
}

src/test/run-pass/issue-2185.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
// ignore-test
12-
// ignore-lexer-test FIXME #15881
1312

1413
// notes on this test case:
1514
// On Thu, Apr 18, 2013-2014 at 6:30 PM, John Clements <[email protected]> wrote:

0 commit comments

Comments
 (0)