Skip to content

Commit

Permalink
Replace ... by ..= in range expr tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Badel2 committed Sep 27, 2017
1 parent 2886000 commit feb7a6a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions tests/source/expr.rs
Expand Up @@ -250,17 +250,17 @@ fn issue767() {

fn ranges() {
let x = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa .. bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
let y = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ... bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
let z = ... x ;
let y = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ..= bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
let z = ..= x ;

// #1766
let x = [0. ..10.0];
let x = [0. ...10.0];
let x = [0. ..=10.0];

a ... b
a ..= b

// the expr below won't compile for some reason...
// let a = 0 ... ;
// the expr below won't compile because inclusive ranges need a defined end
// let a = 0 ..= ;
}

fn if_else() {
Expand Down
4 changes: 2 additions & 2 deletions tests/source/spaces-around-ranges.rs
Expand Up @@ -4,12 +4,12 @@ fn bar(v: &[u8]) {}

fn foo() {
let a = vec![0; 20];
for j in 0...20 {
for j in 0..=20 {
for i in 0..3 {
bar(a[i..j]);
bar(a[i..]);
bar(a[..j]);
bar(a[...(j + 1)]);
bar(a[..=(j + 1)]);
}
}
}
12 changes: 6 additions & 6 deletions tests/target/expr.rs
Expand Up @@ -316,17 +316,17 @@ fn issue767() {
fn ranges() {
let x = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
let y =
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
let z = ...x;
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..=bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
let z = ..=x;

// #1766
let x = [0. ..10.0];
let x = [0. ...10.0];
let x = [0. ..=10.0];

a...b
a..=b

// the expr below won't compile for some reason...
// let a = 0 ... ;
// the expr below won't compile because inclusive ranges need a defined end
// let a = 0 ..= ;
}

fn if_else() {
Expand Down
4 changes: 2 additions & 2 deletions tests/target/spaces-around-ranges.rs
Expand Up @@ -4,12 +4,12 @@ fn bar(v: &[u8]) {}

fn foo() {
let a = vec![0; 20];
for j in 0 ... 20 {
for j in 0 ..= 20 {
for i in 0 .. 3 {
bar(a[i .. j]);
bar(a[i ..]);
bar(a[.. j]);
bar(a[... (j + 1)]);
bar(a[..= (j + 1)]);
}
}
}

0 comments on commit feb7a6a

Please sign in to comment.