Skip to content

Commit 2ad5abd

Browse files
committed
[rust] Include cache paths with non-ascii characters in test (#14066)
1 parent b0851bf commit 2ad5abd

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

rust/tests/cache_tests.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,23 @@
1717

1818
use crate::common::get_driver_path;
1919
use assert_cmd::Command;
20+
use rstest::rstest;
2021
use std::fs;
2122
use std::path::Path;
2223

2324
mod common;
2425

25-
#[test]
26-
fn cache_path_test() {
26+
#[rstest]
27+
#[case("../tmp")]
28+
#[case("../áèîö")]
29+
#[case("../テスト")]
30+
fn cache_path_test(#[case] tmp_cache_folder_name: String) {
2731
let mut cmd = Command::new(env!("CARGO_BIN_EXE_selenium-manager"));
28-
let tmp_cache_folder_name = "../tmp";
2932
cmd.args([
3033
"--browser",
3134
"chrome",
3235
"--cache-path",
33-
tmp_cache_folder_name,
36+
&tmp_cache_folder_name,
3437
"--output",
3538
"json",
3639
])
@@ -42,7 +45,7 @@ fn cache_path_test() {
4245
println!("*** Custom cache path: {}", driver_path);
4346
assert!(!driver_path.contains(r"cache\selenium"));
4447

45-
let tmp_cache_path = Path::new(tmp_cache_folder_name);
48+
let tmp_cache_path = Path::new(&tmp_cache_folder_name);
4649
fs::remove_dir_all(tmp_cache_path).unwrap();
4750
assert!(!tmp_cache_path.exists());
4851
}

0 commit comments

Comments
 (0)