Skip to content

Commit

Permalink
SCHEMA: Make expression tests more manageable
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Oct 12, 2023
1 parent 2d0c111 commit 0204c98
Showing 1 changed file with 13 additions and 43 deletions.
56 changes: 13 additions & 43 deletions src/schema/meta/expression_tests.yaml
Original file line number Diff line number Diff line change
@@ -1,55 +1,35 @@
---
# null fall-through logic
- expression: sidecar.MissingValue
result: null
- expression: null.anything
result: null
- expression: sidecar.MissingValue != true
result: true
- expression: null.anything != true
result: true
- expression: (null)
result: null
- expression: null[0]
result: null
- expression: null[0] != true
result: true
- expression: null && true
result: null
- expression: null || true
result: null
- expression: true && null
result: null
- expression: false && null
result: false
- expression: true || null
result: true
- expression: null || true
result: true
- expression: false || null
result: null
- expression: '!null'
result: null
- expression: null + 1
result: null
- expression: null - 1
result: null
- expression: null * 1
result: null
- expression: null / 1
result: null
- expression: 1 + null
result: null
- expression: 1 - null
result: null
- expression: 1 * null
result: null
- expression: 1 / null
result: null
- expression: "'str1' + null"
result: null
- expression: "null + 'str1'"
result: null
result: true
- expression: intersects([], null)
result: null
result: false
- expression: intersects(null, [])
result: null
result: false
- expression: match(null, 'pattern')
result: null
result: false
- expression: match('string', null)
result: null
result: false
- expression: substr(null, 1, 4)
result: null
- expression: substr('string', null, 4)
Expand Down Expand Up @@ -85,21 +65,11 @@
- expression: exists([], null)
result: false

# Truth/falsity of final expressions
- expression: evaluate(true)
result: true
- expression: evaluate(false)
result: false
- expression: evaluate(null)
result: false

# General expressions
- expression: 1 + 2
result: 3
- expression: '"cat" + "dog"'
result: 'catdog'
- expression: '1 + "cat"'
result: null
- expression: match('string', '.*')
result: true
- expression: match('', '.')
Expand Down

0 comments on commit 0204c98

Please sign in to comment.