Skip to content

Commit 4d9975b

Browse files
committed
Add a feature test for Miri
1 parent 6a9fa4e commit 4d9975b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/spec/features/tools_spec.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,24 @@ def code_with_lint_warnings
3737
EOF
3838
end
3939

40+
scenario "sanitize code with Miri" do
41+
editor.set code_with_undefined_behavior
42+
in_tools_menu { click_on("Miri") }
43+
44+
within(".output-stderr") do
45+
expect(page).to have_content /pointer computed at offset 1, outside bounds of allocation \d+ which has size 0/
46+
end
47+
end
48+
49+
def code_with_undefined_behavior
50+
<<~EOF
51+
fn main() {
52+
let mut a: [u8; 0] = [];
53+
unsafe { *a.get_unchecked_mut(1) = 1; }
54+
}
55+
EOF
56+
end
57+
4058
def editor
4159
Editor.new(page)
4260
end

0 commit comments

Comments
 (0)