Skip to content

Commit

Permalink
[rust] Include cache paths with non-ascii characters in test (#14066)
Browse files Browse the repository at this point in the history
  • Loading branch information
bonigarcia committed Jun 3, 2024
1 parent b0851bf commit 2ad5abd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions rust/tests/cache_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,23 @@

use crate::common::get_driver_path;
use assert_cmd::Command;
use rstest::rstest;
use std::fs;
use std::path::Path;

mod common;

#[test]
fn cache_path_test() {
#[rstest]
#[case("../tmp")]
#[case("../áèîö")]
#[case("../テスト")]
fn cache_path_test(#[case] tmp_cache_folder_name: String) {
let mut cmd = Command::new(env!("CARGO_BIN_EXE_selenium-manager"));
let tmp_cache_folder_name = "../tmp";
cmd.args([
"--browser",
"chrome",
"--cache-path",
tmp_cache_folder_name,
&tmp_cache_folder_name,
"--output",
"json",
])
Expand All @@ -42,7 +45,7 @@ fn cache_path_test() {
println!("*** Custom cache path: {}", driver_path);
assert!(!driver_path.contains(r"cache\selenium"));

let tmp_cache_path = Path::new(tmp_cache_folder_name);
let tmp_cache_path = Path::new(&tmp_cache_folder_name);
fs::remove_dir_all(tmp_cache_path).unwrap();
assert!(!tmp_cache_path.exists());
}

0 comments on commit 2ad5abd

Please sign in to comment.