Skip to content

Commit

Permalink
Type inference unittesting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeny Skvortsvo committed Jul 18, 2023
1 parent 816d454 commit 9b49a2e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
21 changes: 21 additions & 0 deletions integration_tests/psql_combine2_test.l
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

@Engine("psql");

T({t: 1, r: 3});
T({t: 2, r: 4});

Test({a:1, dr: 2 * r}) = {b:2, c: d} :- d List= ({z: 2*i + t} :- i in Range(3)), T({t:, r:});
6 changes: 6 additions & 0 deletions integration_tests/psql_combine2_test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
col0 | logica_value
-------+---------------------
(1,6) | (2,"{(1),(3),(5)}")
(1,8) | (2,"{(2),(4),(6)}")
(2 rows)

1 change: 1 addition & 0 deletions integration_tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def RunAll(test_presto=False, test_trino=False):
RunTest("psql_purchase2_test")
RunTest("psql_purchase3_test")
RunTest("psql_combine_test")
RunTest("psql_combine2_test")
RunTest("psql_record_combine_test")
RunTest("psql_structs_ground_test")
RunTest("psql_simple_structs_test")
Expand Down

0 comments on commit 9b49a2e

Please sign in to comment.