diff options
author | Arne Juul <arnej@verizonmedia.com> | 2020-07-14 11:03:42 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2020-07-15 15:39:24 +0000 |
commit | 9debffd31d309a7fe4062241a731d5722f4199e0 (patch) | |
tree | 53a6e0ec72e6f74f57b05736ca16290e17da0aa6 /container-search/src/test/java/com | |
parent | c5fc3ffbbd620f50992ac978fe0dab46a0d19f4f (diff) |
refactor and require unit for distance
Diffstat (limited to 'container-search/src/test/java/com')
-rw-r--r-- | container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java | 8 | ||||
-rw-r--r-- | container-search/src/test/java/com/yahoo/select/SelectTestCase.java | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java b/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java index 75199eeec55..62a9e27cd96 100644 --- a/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java @@ -549,7 +549,7 @@ public class YqlParserTestCase { @Test public void testGeoLocation() { - assertParse("select foo from bar where geoLocation(workplace, 63.418417, 10.433033, 500000);", + assertParse("select foo from bar where geoLocation(workplace, 63.418417, 10.433033, \"0.5 deg\");", "GEO_LOCATION workplace:(2,10433033,63418417,500000,0,1,0,1921876103)"); assertParse("select foo from bar where geoLocation(headquarters, \"37.416383\", \"-122.024683\", \"100 miles\");", "GEO_LOCATION headquarters:(2,-122024683,37416383,1450561,0,1,0,3411238761)"); @@ -558,10 +558,10 @@ public class YqlParserTestCase { assertParseFail("select foo from bar where geoLocation(qux, 1, 2);", new IllegalArgumentException("Expected 4 arguments, got 3.")); - assertParseFail("select foo from bar where geoLocation(qux, 1.0, \"N1.0\", 100);", + assertParseFail("select foo from bar where geoLocation(qux, 2.0, \"N5.0\", \"0.5 deg\");", new IllegalArgumentException( - "Invalid geoLocation coordinates '1.0 -> latitude(1.0)' and 'N1.0 -> latitude(1.0)'")); - assertParse("select foo from bar where geoLocation(workplace, -12, -34, -77);", + "Invalid geoLocation coordinates 'Latitude: 2.0 degrees' and 'Latitude: 5.0 degrees'")); + assertParse("select foo from bar where geoLocation(workplace, -12, -34, \"-77 d\");", "GEO_LOCATION workplace:(2,-34000000,-12000000,-1,0,1,0,4201111954)"); } diff --git a/container-search/src/test/java/com/yahoo/select/SelectTestCase.java b/container-search/src/test/java/com/yahoo/select/SelectTestCase.java index af1c1e48011..f297fd69f24 100644 --- a/container-search/src/test/java/com/yahoo/select/SelectTestCase.java +++ b/container-search/src/test/java/com/yahoo/select/SelectTestCase.java @@ -523,13 +523,13 @@ public class SelectTestCase { @Test public void testGeoLocation() { - assertParse("{ \"geoLocation\": [ \"workplace\", 63.418417, 10.433033, 500000 ] }", + assertParse("{ \"geoLocation\": [ \"workplace\", 63.418417, 10.433033, \"0.5 deg\" ] }", "GEO_LOCATION workplace:(2,10433033,63418417,500000,0,1,0,1921876103)"); assertParse("{ \"geoLocation\": [ \"headquarters\", \"37.416383\", \"-122.024683\", \"100 miles\" ] }", "GEO_LOCATION headquarters:(2,-122024683,37416383,1450561,0,1,0,3411238761)"); assertParse("{ \"geoLocation\": [ \"home\", \"E10.433033\", \"N63.418417\", \"5km\" ] }", "GEO_LOCATION home:(2,10433033,63418417,45066,0,1,0,1921876103)"); - assertParse("{ \"geoLocation\": [ \"workplace\", -12.0, -34.0, -77 ] }", + assertParse("{ \"geoLocation\": [ \"workplace\", -12.0, -34.0, \"-77 deg\" ] }", "GEO_LOCATION workplace:(2,-34000000,-12000000,-1,0,1,0,4201111954)"); } |