From 92c70766fd2db34fa025c2d8c7dad25f6cb0b17e Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 6 Dec 2022 16:47:56 -0500 Subject: [PATCH] fix rust coverage on windows it's a complete mystery why this isn't needed on other platforms, the branch is legitimately uncovered there --- tests/languages/rust_test.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/languages/rust_test.py b/tests/languages/rust_test.py index 9bf97830..f011e719 100644 --- a/tests/languages/rust_test.py +++ b/tests/languages/rust_test.py @@ -68,3 +68,23 @@ def test_installs_with_bootstrapped_rustup(tmpdir, language_version): with rust.in_env(prefix, language_version): assert cmd_output('hello_world')[1] == 'Hello, world!\n' + + +def test_installs_with_existing_rustup(tmpdir): + tmpdir.join('src', 'main.rs').ensure().write( + 'fn main() {\n' + ' println!("Hello, world!");\n' + '}\n', + ) + tmpdir.join('Cargo.toml').ensure().write( + '[package]\n' + 'name = "hello_world"\n' + 'version = "0.1.0"\n' + 'edition = "2021"\n', + ) + prefix = Prefix(str(tmpdir)) + + assert parse_shebang.find_executable('rustup') is not None + rust.install_environment(prefix, '1.56.0', ()) + with rust.in_env(prefix, '1.56.0'): + assert cmd_output('hello_world')[1] == 'Hello, world!\n'