From 6f15eeea26b9b04d72fed2972c3a6f9e23ec8789 Mon Sep 17 00:00:00 2001 From: "ms.evilhat" <ms.evilhat@gmail.com> Date: Fri, 12 Aug 2022 13:01:22 +0300 Subject: [PATCH] test(query): add test on not_equal --- test_app/test/integration/api_test.lua | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/test_app/test/integration/api_test.lua b/test_app/test/integration/api_test.lua index a4dccd13d4..3672c39974 100644 --- a/test_app/test/integration/api_test.lua +++ b/test_app/test/integration/api_test.lua @@ -130,6 +130,41 @@ g.test_incorrect_query = function() t.assert_str_contains(tostring(err), "Parsing error") end +g.test_not_eq = function() + local api = cluster:server("api-1").net_box + -- id=1 already in space + local r, err = api:call("query", { + [[insert into "testing_space" ("id", "name", "product_units") values (?, ?, ?), (?, ?, ?)]], + {2, "123", 2, 3, "123", 3} + }) + t.assert_equals(err, nil) + t.assert_equals(r, {row_count = 2}) + + + local r, err = api:call("query", { [[SELECT * FROM "testing_space" where "id" <> 1]], { } }) + t.assert_equals(err, nil) + t.assert_equals(r, { + metadata = { + {name = "id", type = "integer"}, + {name = "name", type = "string"}, + {name = "product_units", type = "integer"}, + }, + rows = {{2, "123", 2}, {3, "123", 3}}, + }) + + + local r, err = api:call("query", { [[SELECT * FROM "testing_space" where "id" <> 1 and "product_units" <> 3]], { } }) + t.assert_equals(err, nil) + t.assert_equals(r, { + metadata = { + {name = "id", type = "integer"}, + {name = "name", type = "string"}, + {name = "product_units", type = "integer"}, + }, + rows = {{2, "123", 2}}, + }) +end + g.test_join_query_is_valid = function() local api = cluster:server("api-1").net_box -- GitLab