File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change 7
7
8
8
before do
9
9
visit '/'
10
- editor . set ( rust_2018_code )
10
+ editor . set ( rust_edition_code )
11
11
end
12
12
13
13
scenario "using the 2015 edition" do
14
14
in_advanced_options_menu { select '2015' }
15
15
click_on ( "Run" )
16
16
17
17
within ( :output , :stderr ) do
18
- expect ( page ) . to have_content 'unused variable: `async`'
19
- expect ( page ) . to_not have_content 'expected identifier, found keyword `async`'
18
+ expect ( page ) . to have_content 'cannot find struct, variant or union type `async` in this scope'
20
19
end
21
20
end
22
21
25
24
click_on ( "Run" )
26
25
27
26
within ( :output , :stderr ) do
28
- expect ( page ) . to have_content 'expected identifier, found keyword `async`'
29
- expect ( page ) . to_not have_content 'unused variable: `async`'
27
+ expect ( page ) . to have_content "thread 'main' panicked at 'Box<Any>'"
28
+ end
29
+ end
30
+
31
+ scenario "using the 2021 edition" do
32
+ in_advanced_options_menu { select '2021' }
33
+ click_on ( "Run" )
34
+
35
+ within ( :output , :stderr ) do
36
+ expect ( page ) . to have_content 'format argument must be a string literal' , wait : 10
30
37
end
31
38
end
32
39
33
40
def editor
34
41
Editor . new ( page )
35
42
end
36
43
37
- def rust_2018_code
44
+ def rust_edition_code
38
45
<<~EOF
46
+ #![allow(non_fmt_panic)]
39
47
fn main() {
40
- let async = 42;
48
+ panic!( async {})
41
49
}
42
50
EOF
43
51
end
You can’t perform that action at this time.
0 commit comments