Skip to content

Commit 74e2c31

Browse files
Couple of unhappy path
1 parent 3614fd9 commit 74e2c31

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

query/analyze/structure.feature

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,3 +239,62 @@ Feature: Basic Analyze queries
239239
])
240240
"""
241241
Given transaction closes
242+
243+
# Unhappy path
244+
245+
Scenario: Unsatisfiable schema queries still return
246+
Given connection open schema transaction for database: typedb
247+
Given typeql schema query
248+
"""
249+
define
250+
relation new-relation, relates new-role;
251+
"""
252+
Given transaction commits
253+
254+
Given connection open read transaction for database: typedb
255+
When get answers of typeql analyze query
256+
"""
257+
match
258+
$p sub! person;
259+
"""
260+
Then analyzed query pipeline structure is:
261+
"""
262+
Pipeline([
263+
Match(
264+
[SubExact($p, person)]
265+
)
266+
])
267+
"""
268+
269+
When get answers of typeql analyze query
270+
"""
271+
match
272+
$r sub friendship, relates new-role;
273+
"""
274+
Then analyzed query pipeline structure is:
275+
"""
276+
Pipeline([
277+
Match(
278+
[Sub($r, friendship), Relates($r, new-role)]
279+
)
280+
])
281+
"""
282+
283+
Given transaction closes
284+
285+
286+
Scenario: Errors in the query are returned as errors
287+
Given connection open read transaction for database: typedb
288+
When typeql analyze query; parsing fails
289+
"""
290+
match
291+
This isnt valid TypeQL;
292+
"""
293+
294+
When typeql analyze query; fails with a message containing: "Type-inference was unable to find compatible types for the pair of variables 'x' & 'p' across a constraint"
295+
"""
296+
match
297+
$p sub! person; $x isa! $p;
298+
"""
299+
Given transaction closes
300+

0 commit comments

Comments
 (0)