Skip to content

Commit

Permalink
tests: add test for #2294
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Nov 17, 2024
1 parent 2259608 commit 75edd9e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/test_tojsonl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,31 @@ fn tojsonl_simple() {
assert_eq!(got, expected);
}

#[test]
#[serial]
fn tojsonl_2294() {
let wrk = Workdir::new("tojsonl_simple");
wrk.create(
"file.csv",
vec![
svec!["col1", "col2", "col3"],
svec!["a", "b", "c"],
svec!["d", "e", "f"],
],
);

wrk.create_subdir("qsv test").unwrap();
std::fs::rename(wrk.path("file.csv"), wrk.path("qsv test").join("file.csv")).unwrap();

let mut cmd = wrk.command("tojsonl");
cmd.arg("qsv test/file.csv");

let got: String = wrk.stdout(&mut cmd);
let expected = r#"{"col1":"a","col2":"b","col3":"c"}
{"col1":"d","col2":"e","col3":"f"}"#;
assert_eq!(got, expected);
}

#[test]
#[serial]
fn tojsonl_boolean() {
Expand Down

0 comments on commit 75edd9e

Please sign in to comment.