Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCHEMA: Make expression tests more manageable #1629

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 10 additions & 38 deletions src/schema/meta/expression_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,26 @@
result: null
- 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
- expression: match('string', null)
result: null
result: false
- expression: substr(null, 1, 4)
result: null
- expression: substr('string', null, 4)
Expand Down Expand Up @@ -79,27 +59,19 @@
- expression: null == 1
result: false
- expression: '"VolumeTiming" in null'
result: false
result: null
- expression: exists(null, "bids-uri")
result: false
result: 0
- expression: exists([], null)
result: false

# Truth/falsity of final expressions
- expression: evaluate(true)
result: 0
- expression: true || sidecar.MissingValue
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