Skip to content

Commit

Permalink
Adding more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Wilson <[email protected]>
  • Loading branch information
hyperbolic2346 committed Nov 21, 2023
1 parent a131d00 commit a0ad229
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
12 changes: 10 additions & 2 deletions src/main/cpp/tests/parse_uri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ TEST_F(ParseURIProtocolTests, SparkEdges)
"www.nvidia.com:8100/servlet/"
"impc.DisplayCredits?primekey_in=2000041100:05:14115240636",
"https://nvidia.com/2Ru15Ss ",
"http://www.nvidia.com/plugins//##"});
"http://www.nvidia.com/plugins//##",
"www.nvidia.com:81/Free.fr/L7D9qw9X4S-aC0&amp;D4X0/Panels&amp;solutionId=0X54a/"
"cCdyncharset=UTF-8&amp;t=01wx58Tab&amp;ps=solution/"
"ccmd=_help&amp;locale0X1&amp;countrycode=MA/",
"http://www.nvidia.com/tags.php?%2F88\323\351\300ึณวน\331\315\370%2F",
"http://www.nvidia.com//wp-admin/includes/index.html#9389#123"});

auto result = spark_rapids_jni::parse_uri_to_protocol(cudf::strings_column_view{col});

Expand Down Expand Up @@ -118,8 +123,11 @@ TEST_F(ParseURIProtocolTests, SparkEdges)
"",
"www.nvidia.com",
"",
"",
"www.nvidia.com",
"",
""},
{1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0});
{1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0});

printf("expected:\n");
cudf::test::print(expected);
Expand Down
13 changes: 8 additions & 5 deletions src/test/java/com/nvidia/spark/rapids/jni/ParseURITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void buildExpectedAndRun(String[] testData) {
@Test
void parseURIToProtocolSparkTest() {
String[] testData = {
/*"https://nvidia.com/https&#://nvidia.com",
"https://nvidia.com/https&#://nvidia.com",
"https://http://www.nvidia.com",
"filesystemmagicthing://bob.yaml",
"nvidia.com:8080",
Expand All @@ -69,9 +69,9 @@ void parseURIToProtocolSparkTest() {
"https://www.nvidia.com:8080/q",
"https://www.nvidia.com#8080",
"file://path/to/cool/file",
"http//www.nvidia.com/q",*/
"http//www.nvidia.com/q",
"http://?",
"http://#",/*
"http://#",
"http://??",
"http://??/",
"http://user:pass@host/file;param?query;p2",
Expand All @@ -80,8 +80,11 @@ void parseURIToProtocolSparkTest() {
"https://nvidia.com/2Ru15Ss ",
"http://www.nvidia.com/xmlrpc//##",
"www.nvidia.com:8080/expert/sciPublication.jsp?ExpertId=1746&lenList=all",
"www.nvidia.com:8080/hrcxtf/view?docId=ead/00073.xml&query=T.%20E.%20Lawrence&query-join=and",*/
"",
"www.nvidia.com:8080/hrcxtf/view?docId=ead/00073.xml&query=T.%20E.%20Lawrence&query-join=and",
"www.nvidia.com:81/Free.fr/L7D9qw9X4S-aC0&amp;D4X0/Panels&amp;solutionId=0X54a/cCdyncharset=UTF-8&amp;t=01wx58Tab&amp;ps=solution/ccmd=_help&amp;locale0X1&amp;countrycode=MA/",
"http://www.nvidia.com/tags.php?%2F88\323\351\300ึณวน\331\315\370%2F",
"http://www.nvidia.com//wp-admin/includes/index.html#9389#123",
"",
null};

buildExpectedAndRun(testData);
Expand Down

0 comments on commit a0ad229

Please sign in to comment.