Skip to content

Commit

Permalink
tests: adjust template tests to take into account subdir distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Dec 10, 2024
1 parent ad6c48b commit 5f0c905
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ fn template_output_directory() {
wrk.assert_success(&mut cmd);

// Check that files were created with default ROWNO naming
let file1 = wrk.read_to_string(&format!("{outdir}/1.txt"));
let file2 = wrk.read_to_string(&format!("{outdir}/2.txt"));
let file1 = wrk.read_to_string(&format!("{outdir}/0/1.txt"));
let file2 = wrk.read_to_string(&format!("{outdir}/0/2.txt"));

assert_eq!(file1, "Hello John from New York!");
assert_eq!(file2, "Hello Jane from Boston!");
Expand All @@ -301,8 +301,8 @@ fn template_output_custom_filename() {
wrk.assert_success(&mut cmd);

// Check that files were created with custom naming
let file1 = wrk.read_to_string(&format!("{outdir}/John_greeting-1.txt"));
let file2 = wrk.read_to_string(&format!("{outdir}/Jane_greeting-2.txt"));
let file1 = wrk.read_to_string(&format!("{outdir}/0/John_greeting-1.txt"));
let file2 = wrk.read_to_string(&format!("{outdir}/0/Jane_greeting-2.txt"));

assert_eq!(file1, "Greetings from New York!");
assert_eq!(file2, "Greetings from Boston!");
Expand All @@ -325,8 +325,8 @@ fn template_output_directory_no_headers() {
wrk.assert_success(&mut cmd);

// Check files with row numbers
let file1 = wrk.read_to_string(&format!("{outdir}/1.txt"));
let file2 = wrk.read_to_string(&format!("{outdir}/2.txt"));
let file1 = wrk.read_to_string(&format!("{outdir}/0/1.txt"));
let file2 = wrk.read_to_string(&format!("{outdir}/0/2.txt"));

assert_eq!(file1, "Record: John - New York");
assert_eq!(file2, "Record: Jane - Boston");
Expand Down

0 comments on commit 5f0c905

Please sign in to comment.