Skip to content

Commit

Permalink
test: correct sqlp_issue2014 test
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Oct 31, 2024
1 parent 68a7fe8 commit d7db5ec
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions tests/test_sqlp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1523,23 +1523,34 @@ fn sqlp_issue2014() {

wrk.assert_success(&mut cmd);

let mut cmd2 = wrk.command("slice"); // DevSkim: ignore DS126858
cmd2.arg(output_file.clone()); // DevSkim: ignore DS126858

let got: Vec<Vec<String>> = wrk.read_stdout(&mut cmd2); // DevSkim: ignore DS126858
let mut cmd = wrk.command("snappy");
cmd.arg("decompress").arg(output_file.clone());
let got: Vec<Vec<String>> = wrk.read_stdout(&mut cmd);
let expected = vec![
["id;item;price"],
["0;wallet;9.99"],
["1;comb;1.39"],
["2;pencil;0.49"],
];
assert_eq!(got, expected);

let mut cmd = wrk.command("slice");
cmd.arg(output_file.clone());

let got: Vec<Vec<String>> = wrk.read_stdout(&mut cmd);
let expected = vec![
svec!["id", "item", "price"],
svec!["0", "wallet", "9.99"],
svec!["1", "comb", "1.39"],
svec!["2", "pencil", "0.49"],
];

assert_eq!(got, expected);

let mut cmd2 = wrk.command("headers"); // DevSkim: ignore DS126858
cmd2.arg(output_file); // DevSkim: ignore DS126858
let mut cmd = wrk.command("headers");
cmd.arg(output_file);

let got: Vec<Vec<String>> = wrk.read_stdout(&mut cmd2); // DevSkim: ignore DS126858
let got: Vec<Vec<String>> = wrk.read_stdout(&mut cmd);
let expected = vec![["1 id"], ["2 item"], ["3 price"]];

assert_eq!(got, expected);
Expand Down

0 comments on commit d7db5ec

Please sign in to comment.