diff --git a/test/api/cli/sql/SQLTest.cpp b/test/api/cli/sql/SQLTest.cpp index 0a6ff131c..d6f85dfc9 100644 --- a/test/api/cli/sql/SQLTest.cpp +++ b/test/api/cli/sql/SQLTest.cpp @@ -104,7 +104,7 @@ MAKE_TEST_CASE("select_asterisk", 6) MAKE_TEST_CASE("distinct", 4) -MAKE_TEST_CASE("strings", 3) +MAKE_TEST_CASE("strings", 5) MAKE_TEST_CASE("between", 4) // TODO Use the scripts testing failure cases. diff --git a/test/api/cli/sql/between_1.daphne b/test/api/cli/sql/between_1.daphne index 2bbf5eb94..b010967a1 100644 --- a/test/api/cli/sql/between_1.daphne +++ b/test/api/cli/sql/between_1.daphne @@ -1,4 +1,4 @@ -# Aggregation with avg without group clause. +# BETWEEN clause test with Strings as attributes f = createFrame( [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], diff --git a/test/api/cli/sql/between_2.daphne b/test/api/cli/sql/between_2.daphne index 2cd819f54..1a264e5c1 100644 --- a/test/api/cli/sql/between_2.daphne +++ b/test/api/cli/sql/between_2.daphne @@ -1,4 +1,4 @@ -# Aggregation with avg without group clause. +# BETWEEN clause test with Integers as attribute f = createFrame( [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], diff --git a/test/api/cli/sql/between_3.daphne b/test/api/cli/sql/between_3.daphne index 2d08254fa..30a97fa2e 100644 --- a/test/api/cli/sql/between_3.daphne +++ b/test/api/cli/sql/between_3.daphne @@ -1,4 +1,4 @@ -# Aggregation with avg without group clause. +# Multiple BETWEEN clause test f = createFrame( [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], diff --git a/test/api/cli/sql/between_4.daphne b/test/api/cli/sql/between_4.daphne index e5444d01d..78f5f8d57 100644 --- a/test/api/cli/sql/between_4.daphne +++ b/test/api/cli/sql/between_4.daphne @@ -1,4 +1,4 @@ -# Aggregation with avg without group clause. +# BETWEEN clause test with following AND from the WHERE clause f = createFrame( [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], diff --git a/test/api/cli/sql/strings_1.daphne b/test/api/cli/sql/strings_1.daphne index ed9a3f0e0..00f8f21f3 100644 --- a/test/api/cli/sql/strings_1.daphne +++ b/test/api/cli/sql/strings_1.daphne @@ -1,4 +1,4 @@ -# Aggregation with avg without group clause. +# String for SQL test using equality f = createFrame( [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], diff --git a/test/api/cli/sql/strings_2.daphne b/test/api/cli/sql/strings_2.daphne index 645b484d7..8b4dbc2e0 100644 --- a/test/api/cli/sql/strings_2.daphne +++ b/test/api/cli/sql/strings_2.daphne @@ -1,4 +1,4 @@ -# Aggregation with avg without group clause. +# String for SQL test using greater than comparision f = createFrame( [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], diff --git a/test/api/cli/sql/strings_3.daphne b/test/api/cli/sql/strings_3.daphne index 4d1941b9e..0595e0918 100644 --- a/test/api/cli/sql/strings_3.daphne +++ b/test/api/cli/sql/strings_3.daphne @@ -1,4 +1,4 @@ -# Aggregation with avg without group clause. +# String for SQL test using unequal and escaped double quotes f = createFrame( [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], diff --git a/test/api/cli/sql/strings_4.daphne b/test/api/cli/sql/strings_4.daphne new file mode 100644 index 000000000..7a8445446 --- /dev/null +++ b/test/api/cli/sql/strings_4.daphne @@ -0,0 +1,12 @@ +# String for SQL test using equality and multi character Strings + +f = createFrame( + [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], + [ "Europe", "America", "Africa", "Asia", "Europe", "a", "Oceania", "Europe", "Asia", "Antarctica"], + "a", "b"); + +registerView("f", f); + +res = sql("SELECT f.a, f.b FROM f WHERE f.b = 'Europe';"); + +print(res); \ No newline at end of file diff --git a/test/api/cli/sql/strings_4.txt b/test/api/cli/sql/strings_4.txt new file mode 100644 index 000000000..08107d992 --- /dev/null +++ b/test/api/cli/sql/strings_4.txt @@ -0,0 +1,4 @@ +Frame(3x2, [f.a:int64_t, f.b:std::string]) +0 Europe +4 Europe +7 Europe diff --git a/test/api/cli/sql/strings_5.daphne b/test/api/cli/sql/strings_5.daphne new file mode 100644 index 000000000..eb2f20589 --- /dev/null +++ b/test/api/cli/sql/strings_5.daphne @@ -0,0 +1,12 @@ +# String for SQL test using greater equal and multi character Strings + +f = createFrame( + [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], + [ "Europe", "America", "Africa", "Asia", "Europe", "a", "Oceania", "Europe", "Asia", "Antarctica"], + "a", "b"); + +registerView("f", f); + +res = sql("SELECT f.a, f.b FROM f WHERE f.b >= 'Europe';"); + +print(res); \ No newline at end of file diff --git a/test/api/cli/sql/strings_5.txt b/test/api/cli/sql/strings_5.txt new file mode 100644 index 000000000..1aac1a3b1 --- /dev/null +++ b/test/api/cli/sql/strings_5.txt @@ -0,0 +1,6 @@ +Frame(5x2, [f.a:int64_t, f.b:std::string]) +0 Europe +4 Europe +5 a +6 Oceania +7 Europe