Skip to content

Commit

Permalink
add test for verbose suggestnow result
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Sep 6, 2023
1 parent da13aea commit 248c450
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/test_geocode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ fn geocode_suggest() {
assert_eq!(got, expected);
}

#[test]
fn geocode_suggestnow_default() {
let wrk = Workdir::new("geocode_suggestnow_default");
let mut cmd = wrk.command("geocode");
cmd.arg("suggestnow").arg("Brooklyn");

let got: Vec<Vec<String>> = wrk.read_stdout(&mut cmd);
let expected = vec![
svec!["Location"],
svec!["Brooklyn, New York United States: 40.6501, -73.94958"],
];
assert_eq!(got, expected);
}

#[test]
fn geocode_suggest_intl() {
let wrk = Workdir::new("geocode_suggest_intl");
Expand Down Expand Up @@ -152,7 +166,7 @@ fn geocode_suggestnow() {
.args(["-f", "%city-admin1-country"]);

let got: Vec<Vec<String>> = wrk.read_stdout(&mut cmd);
let expected = vec![svec!["location"], svec!["Paris, Texas United States"]];
let expected = vec![svec!["Location"], svec!["Paris, Texas United States"]];
assert_eq!(got, expected);
}

Expand All @@ -171,7 +185,7 @@ fn geocode_reversenow() {

let got: Vec<Vec<String>> = wrk.read_stdout(&mut cmd);
let expected = vec![
svec!["location"],
svec!["Location"],
svec!["East Flatbush, Kings County, New York - 178464 America/New_York"],
];
assert_eq!(got, expected);
Expand Down

0 comments on commit 248c450

Please sign in to comment.