diff options
| author | Florian Hahn <flo@fhahn.com> | 2015-01-18 22:34:11 +0100 |
|---|---|---|
| committer | Florian Hahn <flo@fhahn.com> | 2015-01-21 00:40:01 +0100 |
| commit | b8efaa69f24b7de89b511f0cf5fbe22956f16370 (patch) | |
| tree | cafb4a875bef0aca11f51a4e0fa6b144d5602274 | |
| parent | 583c5c589ed02e5b6b14a576e35e0ce68988d949 (diff) | |
| download | rust-b8efaa69f24b7de89b511f0cf5fbe22956f16370.tar.gz rust-b8efaa69f24b7de89b511f0cf5fbe22956f16370.zip | |
Add dedicated testcase for #15881
Also enable an ignored test case, closes #15881
| -rw-r--r-- | src/test/run-pass/issue-15881-model-lexer-dotdotdot.rs | 43 | ||||
| -rw-r--r-- | src/test/run-pass/issue-2185.rs | 1 |
2 files changed, 43 insertions, 1 deletions
diff --git a/src/test/run-pass/issue-15881-model-lexer-dotdotdot.rs b/src/test/run-pass/issue-15881-model-lexer-dotdotdot.rs new file mode 100644 index 00000000000..d2f4bac05e9 --- /dev/null +++ b/src/test/run-pass/issue-15881-model-lexer-dotdotdot.rs @@ -0,0 +1,43 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. +// +// regression test for the model lexer handling the DOTDOTDOT syntax (#15877) + +pub fn main() { + match 5u { + 1u...5u => {} + _ => panic!("should match range"), + } + match 5u { + 6u...7u => panic!("shouldn't match range"), + _ => {} + } + match 5u { + 1u => panic!("should match non-first range"), + 2u...6u => {} + _ => panic!("math is broken") + } + match 'c' { + 'a'...'z' => {} + _ => panic!("should suppport char ranges") + } + match -3i { + -7...5 => {} + _ => panic!("should match signed range") + } + match 3.0f64 { + 1.0...5.0 => {} + _ => panic!("should match float range") + } + match -1.5f64 { + -3.6...3.6 => {} + _ => panic!("should match negative float range") + } +} diff --git a/src/test/run-pass/issue-2185.rs b/src/test/run-pass/issue-2185.rs index 1bc1196c491..2543c02d4a1 100644 --- a/src/test/run-pass/issue-2185.rs +++ b/src/test/run-pass/issue-2185.rs @@ -9,7 +9,6 @@ // except according to those terms. // ignore-test -// ignore-lexer-test FIXME #15881 // notes on this test case: // On Thu, Apr 18, 2013-2014 at 6:30 PM, John Clements <clements@brinckerhoff.org> wrote: |
