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

Add a ztest for math between all numeric types #5091

Merged
merged 1 commit into from
Jun 17, 2024
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
147 changes: 147 additions & 0 deletions runtime/sam/expr/ztests/math-coerce.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
script: |
for type1 in $(cat types.txt); do
for type2 in $(cat types.txt); do
echo -n "$type1 $type2: "
echo "{num1: 5($type1), num2: 4($type2)}" | zq -z "yield num1 - num2" -
done
done

inputs:
- name: types.txt
data: |
uint8
uint16
uint32
uint64
int8
int16
int32
int64
float16
float32
float64

outputs:
- name: stdout
data: |
uint8 uint8: 1(uint8)
uint8 uint16: 1(uint16)
uint8 uint32: 1(uint32)
uint8 uint64: 1(uint64)
uint8 int8: 1(int8)
uint8 int16: 1(int16)
uint8 int32: 1(int32)
uint8 int64: 1
uint8 float16: 1.(float16)
uint8 float32: 1.(float32)
uint8 float64: 1.
uint16 uint8: 1(uint16)
uint16 uint16: 1(uint16)
uint16 uint32: 1(uint32)
uint16 uint64: 1(uint64)
uint16 int8: 1(int16)
uint16 int16: 1(int16)
uint16 int32: 1(int32)
uint16 int64: 1
uint16 float16: 1.(float16)
uint16 float32: 1.(float32)
uint16 float64: 1.
uint32 uint8: 1(uint32)
uint32 uint16: 1(uint32)
uint32 uint32: 1(uint32)
uint32 uint64: 1(uint64)
uint32 int8: 1(int32)
uint32 int16: 1(int32)
uint32 int32: 1(int32)
uint32 int64: 1
uint32 float16: 1.(float32)
uint32 float32: 1.(float32)
uint32 float64: 1.
uint64 uint8: 1(uint64)
uint64 uint16: 1(uint64)
uint64 uint32: 1(uint64)
uint64 uint64: 1(uint64)
uint64 int8: 1
uint64 int16: 1
uint64 int32: 1
uint64 int64: 1
uint64 float16: 1.
uint64 float32: 1.
uint64 float64: 1.
int8 uint8: 1(int8)
int8 uint16: 1(int16)
int8 uint32: 1(int32)
int8 uint64: 1
int8 int8: 1(int8)
int8 int16: 1(int16)
int8 int32: 1(int32)
int8 int64: 1
int8 float16: 1.(float16)
int8 float32: 1.(float32)
int8 float64: 1.
int16 uint8: 1(int16)
int16 uint16: 1(int16)
int16 uint32: 1(int32)
int16 uint64: 1
int16 int8: 1(int16)
int16 int16: 1(int16)
int16 int32: 1(int32)
int16 int64: 1
int16 float16: 1.(float16)
int16 float32: 1.(float32)
int16 float64: 1.
int32 uint8: 1(int32)
int32 uint16: 1(int32)
int32 uint32: 1(int32)
int32 uint64: 1
int32 int8: 1(int32)
int32 int16: 1(int32)
int32 int32: 1(int32)
int32 int64: 1
int32 float16: 1.(float32)
int32 float32: 1.(float32)
int32 float64: 1.
int64 uint8: 1
int64 uint16: 1
int64 uint32: 1
int64 uint64: 1
int64 int8: 1
int64 int16: 1
int64 int32: 1
int64 int64: 1
int64 float16: 1.
int64 float32: 1.
int64 float64: 1.
float16 uint8: 1.(float16)
float16 uint16: 1.(float16)
float16 uint32: 1.(float32)
float16 uint64: 1.
float16 int8: 1.(float16)
float16 int16: 1.(float16)
float16 int32: 1.(float32)
float16 int64: 1.
float16 float16: 1.(float16)
float16 float32: 1.(float32)
float16 float64: 1.
float32 uint8: 1.(float32)
float32 uint16: 1.(float32)
float32 uint32: 1.(float32)
float32 uint64: 1.
float32 int8: 1.(float32)
float32 int16: 1.(float32)
float32 int32: 1.(float32)
float32 int64: 1.
float32 float16: 1.(float32)
float32 float32: 1.(float32)
float32 float64: 1.
float64 uint8: 1.
float64 uint16: 1.
float64 uint32: 1.
float64 uint64: 1.
float64 int8: 1.
float64 int16: 1.
float64 int32: 1.
float64 int64: 1.
float64 float16: 1.
float64 float32: 1.
float64 float64: 1.
Loading