-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move tests that include ion data into locations under an
ion
subpath
- Loading branch information
Showing
43 changed files
with
1,824 additions
and
1,462 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
'cast-to-int'::[ | ||
{ | ||
name:"cast to int valid cases{value:\"`-9223372036854775808e0`\",result:-9223372036854775808}", | ||
statement:"cast(`-9223372036854775808e0` as BIGINT)", | ||
assert:{ | ||
result:EvaluationSuccess, | ||
evalMode:[ | ||
EvalModeCoerce, | ||
EvalModeError | ||
], | ||
output:-9223372036854775808 | ||
} | ||
}, | ||
{ | ||
name:"cast to int valid cases{value:\" `\\\"100\\\"` \",result:100}", | ||
statement:"cast( `\"100\"` as INT)", | ||
assert:{ | ||
result:EvaluationSuccess, | ||
evalMode:[ | ||
EvalModeCoerce, | ||
EvalModeError | ||
], | ||
output:100 | ||
} | ||
}, | ||
] | ||
|
||
cast_invalid::[ | ||
{ | ||
name:"cast to int invalid target type{value:\"`2017T`\",target:\"TIMESTAMP\"}", | ||
statement:"cast(`2017T` as INT)", | ||
assert:[ | ||
{ | ||
evalMode:EvalModeError, | ||
result:EvaluationFail | ||
}, | ||
{ | ||
result:EvaluationSuccess, | ||
evalMode:EvalModeCoerce, | ||
output:$missing::null | ||
} | ||
], | ||
}, | ||
{ | ||
name:"cast to int invalid target type{value:\" `{{\\\"\\\"}}` \",target:\"CLOB\"}", | ||
statement:"cast( `{{\"\"}}` as INT)", | ||
assert:[ | ||
{ | ||
evalMode:EvalModeError, | ||
result:EvaluationFail | ||
}, | ||
{ | ||
result:EvaluationSuccess, | ||
evalMode:EvalModeCoerce, | ||
output:$missing::null | ||
} | ||
], | ||
}, | ||
{ | ||
name:"cast to int invalid target type{value:\" `{{\\\"1\\\"}}` \",target:\"CLOB\"}", | ||
statement:"cast( `{{\"1\"}}` as INT)", | ||
assert:[ | ||
{ | ||
evalMode:EvalModeError, | ||
result:EvaluationFail | ||
}, | ||
{ | ||
result:EvaluationSuccess, | ||
evalMode:EvalModeCoerce, | ||
output:$missing::null | ||
} | ||
], | ||
}, | ||
{ | ||
name:"cast to int invalid target type{value:\"`{{}}`\",target:\"BLOB\"}", | ||
statement:"cast(`{{}}` as INT)", | ||
assert:[ | ||
{ | ||
evalMode:EvalModeError, | ||
result:EvaluationFail | ||
}, | ||
{ | ||
result:EvaluationSuccess, | ||
evalMode:EvalModeCoerce, | ||
output:$missing::null | ||
} | ||
], | ||
}, | ||
{ | ||
name:"cast to int invalid target type{value:\"`(1 2)`\",target:\"SEXP\"}", | ||
statement:"cast(`(1 2)` as INT)", | ||
assert:[ | ||
{ | ||
evalMode:EvalModeError, | ||
result:EvaluationFail | ||
}, | ||
{ | ||
result:EvaluationSuccess, | ||
evalMode:EvalModeCoerce, | ||
output:$missing::null | ||
} | ||
], | ||
}, | ||
{ | ||
name:"cast to int invalid target type{value:\"`(1)`\",target:\"SEXP\"}", | ||
statement:"cast(`(1)` as INT)", | ||
assert:[ | ||
{ | ||
evalMode:EvalModeError, | ||
result:EvaluationFail | ||
}, | ||
{ | ||
result:EvaluationSuccess, | ||
evalMode:EvalModeCoerce, | ||
output:$missing::null | ||
} | ||
], | ||
}, | ||
{ | ||
name:"cast to int invalid target type{value:\"`()`\",target:\"SEXP\"}", | ||
statement:"cast(`()` as INT)", | ||
assert:[ | ||
{ | ||
evalMode:EvalModeError, | ||
result:EvaluationFail | ||
}, | ||
{ | ||
result:EvaluationSuccess, | ||
evalMode:EvalModeCoerce, | ||
output:$missing::null | ||
} | ||
], | ||
}, | ||
] |
146 changes: 146 additions & 0 deletions
146
partiql-tests-data/eval/ion/primitives/functions/abs.ion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
abs::[ | ||
{ | ||
name:"ABS(`1d0`) Ion DECIMAL", | ||
statement:"ABS(`1d0`)", | ||
assert:{ | ||
result:EvaluationSuccess, | ||
evalMode:[ | ||
EvalModeCoerce, | ||
EvalModeError | ||
], | ||
output:1d0 | ||
} | ||
}, | ||
{ | ||
name:"ABS(`1e0`) Ion FLOAT", | ||
statement:"ABS(`1e0`)", | ||
assert:{ | ||
result:EvaluationSuccess, | ||
evalMode:[ | ||
EvalModeCoerce, | ||
EvalModeError | ||
], | ||
output:1e0 | ||
} | ||
}, | ||
{ | ||
name:"ABS(`-1d0`)", | ||
statement:"ABS(`-1d0`)", | ||
assert:{ | ||
result:EvaluationSuccess, | ||
evalMode:[ | ||
EvalModeCoerce, | ||
EvalModeError | ||
], | ||
output:1d0 | ||
} | ||
}, | ||
{ | ||
name:"ABS(`-1e0`)", | ||
statement:"ABS(`-1e0`)", | ||
assert:{ | ||
result:EvaluationSuccess, | ||
evalMode:[ | ||
EvalModeCoerce, | ||
EvalModeError | ||
], | ||
output:1e0 | ||
} | ||
}, | ||
{ | ||
name:"ABS(`-0.`)", | ||
statement:"ABS(`-0.`)", | ||
assert:{ | ||
result:EvaluationSuccess, | ||
evalMode:[ | ||
EvalModeCoerce, | ||
EvalModeError | ||
], | ||
output:0d0 | ||
} | ||
}, | ||
{ | ||
name:"ABS(`-0d0`)", | ||
statement:"ABS(`-0d0`)", | ||
assert:{ | ||
result:EvaluationSuccess, | ||
evalMode:[ | ||
EvalModeCoerce, | ||
EvalModeError | ||
], | ||
output:0d0 | ||
} | ||
}, | ||
{ | ||
name:"ABS(`-0d-0`)", | ||
statement:"ABS(`-0d-0`)", | ||
assert:{ | ||
result:EvaluationSuccess, | ||
evalMode:[ | ||
EvalModeCoerce, | ||
EvalModeError | ||
], | ||
output:0d0 | ||
} | ||
}, | ||
{ | ||
name:"ABS(`-0.0d1`)", | ||
statement:"ABS(`-0.0d1`)", | ||
assert:{ | ||
result:EvaluationSuccess, | ||
evalMode:[ | ||
EvalModeCoerce, | ||
EvalModeError | ||
], | ||
output:0d0 | ||
} | ||
}, | ||
{ | ||
name:"ABS(`-0.0000`) preserve scale", | ||
statement:"ABS(`-0.0000`)", | ||
assert:{ | ||
result:EvaluationSuccess, | ||
evalMode:[ | ||
EvalModeCoerce, | ||
EvalModeError | ||
], | ||
output:0d-4 | ||
} | ||
}, | ||
{ | ||
name:"ABS(`-inf`) special value", | ||
statement:"ABS(`-inf`)", | ||
assert:{ | ||
result:EvaluationSuccess, | ||
evalMode:[ | ||
EvalModeCoerce, | ||
EvalModeError | ||
], | ||
output:+inf | ||
} | ||
}, | ||
{ | ||
name:"ABS(`+inf`) special value", | ||
statement:"ABS(`+inf`)", | ||
assert:{ | ||
result:EvaluationSuccess, | ||
evalMode:[ | ||
EvalModeCoerce, | ||
EvalModeError | ||
], | ||
output:+inf | ||
} | ||
}, | ||
{ | ||
name:"ABS(`nan`) special value", | ||
statement:"ABS(`nan`)", | ||
assert:{ | ||
result:EvaluationSuccess, | ||
evalMode:[ | ||
EvalModeCoerce, | ||
EvalModeError | ||
], | ||
output:nan | ||
} | ||
}, | ||
] |
Oops, something went wrong.