Skip to content

Commit b623ff4

Browse files
authored
add tests for cast to and from enum (#6275)
1 parent 7c8b98a commit b623ff4

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

runtime/ztests/expr/cast/enum.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
spq: this::enum(e1,e2)
2+
3+
vector: true
4+
5+
input: |
6+
"e2"
7+
"e3"
8+
0
9+
null
10+
null::string
11+
null::int64
12+
13+
output: |
14+
"e2"::enum(e1,e2)
15+
error({message:"no such symbol in enum(e1,e2)",on:"e3"})
16+
error({message:"cannot cast to enum",on:0})
17+
null::enum(e1,e2)
18+
null::enum(e1,e2)
19+
null::enum(e1,e2)

runtime/ztests/expr/cast/string.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ input: |
2828
{foo:"bar"}
2929
null::{foo:string}
3030
[1,2,3]
31+
"e2"::enum(e1,e2)
3132
3233
output: |
3334
"1"
@@ -55,3 +56,4 @@ output: |
5556
"{foo:\"bar\"}"
5657
null::string
5758
"[1,2,3]"
59+
"e2"

0 commit comments

Comments
 (0)