Skip to content

Commit b8b5baf

Browse files
committed
Test that selecting Rust 2021 works
1 parent bc5b8c3 commit b8b5baf

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

tests/spec/features/editions_spec.rb

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@
77

88
before do
99
visit '/'
10-
editor.set(rust_2018_code)
10+
editor.set(rust_edition_code)
1111
end
1212

1313
scenario "using the 2015 edition" do
1414
in_advanced_options_menu { select '2015' }
1515
click_on("Run")
1616

1717
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'
2019
end
2120
end
2221

@@ -25,19 +24,28 @@
2524
click_on("Run")
2625

2726
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
3037
end
3138
end
3239

3340
def editor
3441
Editor.new(page)
3542
end
3643

37-
def rust_2018_code
44+
def rust_edition_code
3845
<<~EOF
46+
#![allow(non_fmt_panic)]
3947
fn main() {
40-
let async = 42;
48+
panic!(async {})
4149
}
4250
EOF
4351
end

0 commit comments

Comments
 (0)