Skip to content

Commit 7fe0e7a

Browse files
authored
fix standard location of test file (#166)
The test files were renamed to use snake case in: exercism/rust#2036
1 parent f781982 commit 7fe0e7a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ fn main() -> Result<()> {
7070

7171
results_out.push_str(&deterministic_cargo_stderr);
7272

73-
// if there is no test file at the standard location (tests/<slug>.rs),
74-
// pretend like the test file is empty
75-
let test_file =
76-
std::fs::read_to_string(format!("tests/{}.rs", cli_args.slug)).unwrap_or_default();
73+
let snake_slug = cli_args.slug.replace('-', "_");
74+
// if there is no test file at the standard location
75+
// (tests/<snake_slug>.rs), pretend that the test file is empty
76+
let test_file = std::fs::read_to_string(format!("tests/{snake_slug}.rs")).unwrap_or_default();
7777
let name_to_code = parse_test_code::parse_file(&test_file);
7878

7979
let out = convert(

0 commit comments

Comments
 (0)