forked from bytecodealliance/wasmtime-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvaltype_test.go
39 lines (36 loc) · 823 Bytes
/
valtype_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package wasmtime
import "testing"
func TestValType(t *testing.T) {
NewValType(KindI32)
NewValType(KindI64)
NewValType(KindF32)
NewValType(KindF64)
NewValType(KindExternref)
NewValType(KindFuncref)
}
func TestValTypeKind(t *testing.T) {
if NewValType(KindI32).Kind() != KindI32 {
t.Fatalf("wrong kind")
}
if NewValType(KindI64).Kind() != KindI64 {
t.Fatalf("wrong kind")
}
if NewValType(KindF32).Kind() != KindF32 {
t.Fatalf("wrong kind")
}
if NewValType(KindF64).Kind() != KindF64 {
t.Fatalf("wrong kind")
}
if NewValType(KindExternref).Kind() != KindExternref {
t.Fatalf("wrong kind")
}
if NewValType(KindFuncref).Kind() != KindFuncref {
t.Fatalf("wrong kind")
}
if KindI32 == KindI64 {
t.Fatalf("unequal kinds equal")
}
if KindI32 != KindI32 {
t.Fatalf("equal kinds unequal")
}
}