Skip to content

Commit 13392d1

Browse files
committed
Add tests
1 parent 7e2b9ea commit 13392d1

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2014 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+
// Test that the old fixed length array syntax is a parsing error.
12+
13+
fn main() {
14+
let _x: [int, ..3] = [0i, 1, 2]; //~ ERROR
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2014 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+
// Test that the old repeating array syntax gives an error.
12+
13+
fn main() {
14+
let _ = [0i, ..3]; //~ ERROR
15+
}

src/test/run-pass/range.rs

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ pub fn main() {
4141
let _ = 0u..4+4-3;
4242
let _ = 0..foo();
4343

44+
let _ = ..42u;
45+
4446
// Test we can use two different types with a common supertype.
4547
let x = &42i;
4648
{

0 commit comments

Comments
 (0)