Fix tests
This commit is contained in:
parent
cc40f58b8b
commit
51bb31ad25
3 changed files with 10 additions and 7 deletions
|
|
@ -26,19 +26,22 @@ impl<T: Generator<Return = ()>> Iterator for W<T> {
|
|||
}
|
||||
|
||||
fn test() -> impl Generator<Return=(), Yield=u8> {
|
||||
for i in 1..6 {
|
||||
yield i
|
||||
|| {
|
||||
for i in 1..6 {
|
||||
yield i
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let start = 6;
|
||||
let end = 11;
|
||||
|
||||
let closure_test = |start| {
|
||||
let closure_test = || {
|
||||
for i in start..end {
|
||||
yield i
|
||||
}
|
||||
};
|
||||
|
||||
assert!(W(test()).chain(W(closure_test(6))).eq(1..11));
|
||||
assert!(W(test()).chain(W(closure_test)).eq(1..11));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,11 +28,11 @@ error: expected expression, found `;`
|
|||
14 | foo(bar(;
|
||||
| ^
|
||||
|
||||
error: expected one of `)`, `,`, `.`, `<`, `?`, `break`, `continue`, `false`, `for`, `if`, `loop`, `match`, `move`, `return`, `true`, `unsafe`, `while`, or an operator, found `;`
|
||||
error: expected one of `)`, `,`, `.`, `<`, `?`, `break`, `continue`, `false`, `for`, `if`, `loop`, `match`, `move`, `return`, `true`, `unsafe`, `while`, `yield`, or an operator, found `;`
|
||||
--> $DIR/token-error-correct.rs:14:13
|
||||
|
|
||||
14 | foo(bar(;
|
||||
| ^ expected one of 18 possible tokens here
|
||||
| ^ expected one of 19 possible tokens here
|
||||
|
||||
error: expected expression, found `)`
|
||||
--> $DIR/token-error-correct.rs:23:1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue