Skip to content

Commit

Permalink
Revert "Corrects case-when conformance tests" (#132)
Browse files Browse the repository at this point in the history
This reverts commit 5aca10a.
  • Loading branch information
alancai98 authored Jan 21, 2025
1 parent 85a01fb commit 9ff2400
Showing 1 changed file with 48 additions and 72 deletions.
120 changes: 48 additions & 72 deletions partiql-tests-data/eval/primitives/operators/case-operator.ion
Original file line number Diff line number Diff line change
Expand Up @@ -8,89 +8,65 @@ case::[
{
name:"simpleCase",
statement:"SELECT VALUE CASE x + 1 WHEN NULL THEN 'shouldnt be null' WHEN MISSING THEN 'shouldnt be missing' WHEN i THEN 'ONE' WHEN f THEN 'TWO' WHEN d THEN 'THREE' ELSE '?' END FROM << i, f, d, null, missing >> AS x",
assert:[
{
evalMode:EvalModeCoerce,
result:EvaluationSuccess,
output:$bag::[
"TWO",
"THREE",
"?",
"?",
"?"
]
},
{
evalMode: EvalModeError,
result: EvaluationFail
}
]
assert:{
evalMode:[EvalModeCoerce, EvalModeError],
result:EvaluationSuccess,
output:$bag::[
"TWO",
"THREE",
"?",
"?",
"?"
]
}
},
{
name:"simpleCaseNoElse",
statement:"SELECT VALUE CASE x + 1 WHEN NULL THEN 'shouldnt be null' WHEN MISSING THEN 'shouldnt be missing' WHEN i THEN 'ONE' WHEN f THEN 'TWO' WHEN d THEN 'THREE' END FROM << i, f, d, null, missing >> AS x",
assert:[
{
evalMode:EvalModeCoerce,
result:EvaluationSuccess,
output:$bag::[
"TWO",
"THREE",
null,
null,
null
]
},
{
evalMode: EvalModeError,
result: EvaluationFail
}
]
assert:{
evalMode:[EvalModeCoerce, EvalModeError],
result:EvaluationSuccess,
output:$bag::[
"TWO",
"THREE",
null,
null,
null
]
}
},
{
name:"searchedCase",
statement:"SELECT VALUE CASE WHEN x + 1 < i THEN '< ONE' WHEN x + 1 = f THEN 'TWO' WHEN (x + 1 > d) AND (x + 1 < 100) THEN '>= THREE < 100' ELSE '?' END FROM << -1.0000, i, f, d, 100e0, null, missing >> AS x",
assert:[
{
evalMode:EvalModeCoerce,
result:EvaluationSuccess,
output:$bag::[
"< ONE",
"TWO",
"?",
">= THREE < 100",
"?",
"?",
"?"
]
},
{
evalMode: EvalModeError,
result: EvaluationFail
}
]
assert:{
evalMode:[EvalModeCoerce, EvalModeError],
result:EvaluationSuccess,
output:$bag::[
"< ONE",
"TWO",
"?",
">= THREE < 100",
"?",
"?",
"?"
]
}
},
{
name:"searchedCaseNoElse",
statement:"SELECT VALUE CASE WHEN x + 1 < i THEN '< ONE' WHEN x + 1 = f THEN 'TWO' WHEN (x + 1 > d) AND (x + 1 < 100) THEN '>= THREE < 100' END FROM << -1.0000, i, f, d, 100e0, null, missing >> AS x",
assert:[
{
evalMode:EvalModeCoerce,
result:EvaluationSuccess,
output:$bag::[
"< ONE",
"TWO",
null,
">= THREE < 100",
null,
null,
null
]
},
{
evalMode: EvalModeError,
result: EvaluationFail
}
]
assert:{
evalMode:[EvalModeCoerce, EvalModeError],
result:EvaluationSuccess,
output:$bag::[
"< ONE",
"TWO",
null,
">= THREE < 100",
null,
null,
null
]
}
}
]

0 comments on commit 9ff2400

Please sign in to comment.