Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-i-m committed Nov 27, 2018
1 parent 32aafb2 commit e97edad
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 189 deletions.

This file was deleted.

This file was deleted.

45 changes: 0 additions & 45 deletions src/test/ui/macros/macro-at-most-once-rep-2018-feature-gate.rs

This file was deleted.

80 changes: 0 additions & 80 deletions src/test/ui/macros/macro-at-most-once-rep-2018-feature-gate.stderr

This file was deleted.

12 changes: 5 additions & 7 deletions src/test/ui/macros/macro-at-most-once-rep-2018.rs
Expand Up @@ -12,22 +12,20 @@

// edition:2018

#![feature(macro_at_most_once_rep)]

macro_rules! foo {
($(a)?) => {}
($(a)?) => {};
}

macro_rules! baz {
($(a),?) => {} //~ERROR the `?` macro repetition operator
($(a),?) => {}; //~ERROR the `?` macro repetition operator
}

macro_rules! barplus {
($(a)?+) => {} // ok. matches "a+" and "+"
($(a)?+) => {}; // ok. matches "a+" and "+"
}

macro_rules! barstar {
($(a)?*) => {} // ok. matches "a*" and "*"
($(a)?*) => {}; // ok. matches "a*" and "*"
}

pub fn main() {
Expand All @@ -41,7 +39,7 @@ pub fn main() {
barplus!(a); //~ERROR unexpected end of macro invocation
barplus!(a?); //~ ERROR no rules expected the token `?`
barplus!(a?a); //~ ERROR no rules expected the token `?`
barplus!(a+);
barplus!(a);
barplus!(+);

barstar!(); //~ERROR unexpected end of macro invocation
Expand Down
22 changes: 11 additions & 11 deletions src/test/ui/macros/macro-at-most-once-rep-2018.stderr
@@ -1,11 +1,11 @@
error: the `?` macro repetition operator does not take a separator
--> $DIR/macro-at-most-once-rep-2018.rs:22:10
--> $DIR/macro-at-most-once-rep-2018.rs:20:10
|
LL | ($(a),?) => {} //~ERROR the `?` macro repetition operator
| ^

error: no rules expected the token `?`
--> $DIR/macro-at-most-once-rep-2018.rs:36:11
--> $DIR/macro-at-most-once-rep-2018.rs:34:11
|
LL | macro_rules! foo {
| ---------------- when calling this macro
Expand All @@ -14,7 +14,7 @@ LL | foo!(a?); //~ ERROR no rules expected the token `?`
| ^ no rules expected this token in macro call

error: no rules expected the token `?`
--> $DIR/macro-at-most-once-rep-2018.rs:37:11
--> $DIR/macro-at-most-once-rep-2018.rs:35:11
|
LL | macro_rules! foo {
| ---------------- when calling this macro
Expand All @@ -23,7 +23,7 @@ LL | foo!(a?a); //~ ERROR no rules expected the token `?`
| ^ no rules expected this token in macro call

error: no rules expected the token `?`
--> $DIR/macro-at-most-once-rep-2018.rs:38:11
--> $DIR/macro-at-most-once-rep-2018.rs:36:11
|
LL | macro_rules! foo {
| ---------------- when calling this macro
Expand All @@ -32,7 +32,7 @@ LL | foo!(a?a?a); //~ ERROR no rules expected the token `?`
| ^ no rules expected this token in macro call

error: unexpected end of macro invocation
--> $DIR/macro-at-most-once-rep-2018.rs:40:5
--> $DIR/macro-at-most-once-rep-2018.rs:38:5
|
LL | macro_rules! barplus {
| -------------------- when calling this macro
Expand All @@ -50,7 +50,7 @@ LL | barplus!(a); //~ERROR unexpected end of macro invocation
| ^ missing tokens in macro arguments

error: no rules expected the token `?`
--> $DIR/macro-at-most-once-rep-2018.rs:42:15
--> $DIR/macro-at-most-once-rep-2018.rs:40:15
|
LL | macro_rules! barplus {
| -------------------- when calling this macro
Expand All @@ -59,7 +59,7 @@ LL | barplus!(a?); //~ ERROR no rules expected the token `?`
| ^ no rules expected this token in macro call

error: no rules expected the token `?`
--> $DIR/macro-at-most-once-rep-2018.rs:43:15
--> $DIR/macro-at-most-once-rep-2018.rs:41:15
|
LL | macro_rules! barplus {
| -------------------- when calling this macro
Expand All @@ -68,7 +68,7 @@ LL | barplus!(a?a); //~ ERROR no rules expected the token `?`
| ^ no rules expected this token in macro call

error: unexpected end of macro invocation
--> $DIR/macro-at-most-once-rep-2018.rs:47:5
--> $DIR/macro-at-most-once-rep-2018.rs:45:5
|
LL | macro_rules! barstar {
| -------------------- when calling this macro
Expand All @@ -77,7 +77,7 @@ LL | barstar!(); //~ERROR unexpected end of macro invocation
| ^^^^^^^^^^^ missing tokens in macro arguments

error: unexpected end of macro invocation
--> $DIR/macro-at-most-once-rep-2018.rs:48:15
--> $DIR/macro-at-most-once-rep-2018.rs:46:14
|
LL | macro_rules! barstar {
| -------------------- when calling this macro
Expand All @@ -86,7 +86,7 @@ LL | barstar!(a); //~ERROR unexpected end of macro invocation
| ^ missing tokens in macro arguments

error: no rules expected the token `?`
--> $DIR/macro-at-most-once-rep-2018.rs:49:15
--> $DIR/macro-at-most-once-rep-2018.rs:47:15
|
LL | macro_rules! barstar {
| -------------------- when calling this macro
Expand All @@ -95,7 +95,7 @@ LL | barstar!(a?); //~ ERROR no rules expected the token `?`
| ^ no rules expected this token in macro call

error: no rules expected the token `?`
--> $DIR/macro-at-most-once-rep-2018.rs:50:15
--> $DIR/macro-at-most-once-rep-2018.rs:48:15
|
LL | macro_rules! barstar {
| -------------------- when calling this macro
Expand Down

0 comments on commit e97edad

Please sign in to comment.