Skip to content

Commit

Permalink
tests: add join --right-anti and --right-semi tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Dec 25, 2024
1 parent 7a7950f commit 105bbe7
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions tests/test_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ join_test!(
join_outer_full,
|wrk: Workdir, mut cmd: process::Command, headers: bool| {
cmd.arg("--full");

wrk.assert_success(&mut cmd);

let got: Vec<Vec<String>> = wrk.read_stdout(&mut cmd);
let expected = make_rows(
headers,
Expand Down Expand Up @@ -301,3 +304,67 @@ fn join_cross_no_headers() {
];
assert_eq!(got, expected);
}

join_test!(
join_right_semi,
|wrk: Workdir, mut cmd: process::Command, headers: bool| {
cmd.arg("--right-semi");
let got: Vec<Vec<String>> = wrk.read_stdout(&mut cmd);
let expected = make_rows(
headers,
true,
vec![
svec!["Boston", "Logan Airport"],
svec!["Boston", "Boston Garden"],
svec!["Buffalo", "Ralph Wilson Stadium"],
],
);
assert_eq!(got, expected);
}
);

join_test!(
join_right_semi_casei,
|wrk: Workdir, mut cmd: process::Command, headers: bool| {
cmd.arg("--right-semi").arg("--ignore-case");
let got: Vec<Vec<String>> = wrk.read_stdout(&mut cmd);
let expected = make_rows(
headers,
true,
vec![
svec!["Boston", "Logan Airport"],
svec!["Boston", "Boston Garden"],
svec!["Buffalo", "Ralph Wilson Stadium"],
svec!["BOSTON", "BOSTON COMMON"],
],
);
assert_eq!(got, expected);
}
);

join_test!(
join_right_anti,
|wrk: Workdir, mut cmd: process::Command, headers: bool| {
cmd.arg("--right-anti");
let got: Vec<Vec<String>> = wrk.read_stdout(&mut cmd);
let expected = make_rows(
headers,
true,
vec![
svec!["Orlando", "Disney World"],
svec!["BOSTON", "BOSTON COMMON"],
],
);
assert_eq!(got, expected);
}
);

join_test!(
join_right_anti_casei,
|wrk: Workdir, mut cmd: process::Command, headers: bool| {
cmd.arg("--right-anti").arg("--ignore-case");
let got: Vec<Vec<String>> = wrk.read_stdout(&mut cmd);
let expected = make_rows(headers, true, vec![svec!["Orlando", "Disney World"]]);
assert_eq!(got, expected);
}
);

0 comments on commit 105bbe7

Please sign in to comment.