From b8efaa69f24b7de89b511f0cf5fbe22956f16370 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Sun, 18 Jan 2015 22:34:11 +0100 Subject: [PATCH] Add dedicated testcase for #15881 Also enable an ignored test case, closes #15881 --- .../issue-15881-model-lexer-dotdotdot.rs | 43 +++++++++++++++++++ src/test/run-pass/issue-2185.rs | 1 - 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/test/run-pass/issue-15881-model-lexer-dotdotdot.rs 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 or the MIT license +// , 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 wrote: