Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 92c7076

Browse files
committed
fix rust coverage on windows
it's a complete mystery why this isn't needed on other platforms, the branch is legitimately uncovered there
1 parent 0b45ecc commit 92c7076

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

tests/languages/rust_test.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,23 @@ def mocked_find_executable(exe: str) -> str | None:
6868

6969
with rust.in_env(prefix, language_version):
7070
assert cmd_output('hello_world')[1] == 'Hello, world!\n'
71+
72+
73+
def test_installs_with_existing_rustup(tmpdir):
74+
tmpdir.join('src', 'main.rs').ensure().write(
75+
'fn main() {\n'
76+
' println!("Hello, world!");\n'
77+
'}\n',
78+
)
79+
tmpdir.join('Cargo.toml').ensure().write(
80+
'[package]\n'
81+
'name = "hello_world"\n'
82+
'version = "0.1.0"\n'
83+
'edition = "2021"\n',
84+
)
85+
prefix = Prefix(str(tmpdir))
86+
87+
assert parse_shebang.find_executable('rustup') is not None
88+
rust.install_environment(prefix, '1.56.0', ())
89+
with rust.in_env(prefix, '1.56.0'):
90+
assert cmd_output('hello_world')[1] == 'Hello, world!\n'

0 commit comments

Comments
 (0)