From 7c33569c1f0f8812a734fdde49416a40be33d64a Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 19 Oct 2023 17:19:46 -0400 Subject: [PATCH] SCHEMA: Make expression tests more manageable (#1629) * SCHEMA: Make expression tests more manageable * FIX: exists() return type is int * FIX: Expressions again --- src/schema/meta/expression_tests.yaml | 48 ++++++--------------------- 1 file changed, 10 insertions(+), 38 deletions(-) diff --git a/src/schema/meta/expression_tests.yaml b/src/schema/meta/expression_tests.yaml index 4d8c63f008..e1f06fdedc 100644 --- a/src/schema/meta/expression_tests.yaml +++ b/src/schema/meta/expression_tests.yaml @@ -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) @@ -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('', '.')