mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
parent
29fb6c7f6f
commit
4f3e649bf0
@ -1320,38 +1320,35 @@ func TestSyntaxOperatorShift(t *testing.T) {
|
|||||||
stmt string
|
stmt string
|
||||||
err bool
|
err bool
|
||||||
}{
|
}{
|
||||||
{stmt: "b := 2.0; a := 1.0 << 2.0 == b; _ = a", err: false},
|
{stmt: "s := 1; a := 1.0<<s + vec2(1); _ = a", err: true},
|
||||||
{stmt: "s := 1; b := 2.0; a := 1.0<<s == b; _ = a", err: true},
|
{stmt: "s := 1; a := 1.0<<s + ivec2(1); _ = a", err: false},
|
||||||
{stmt: "s := 1; b := 2; a := 1.0<<s == b; _ = a", err: false},
|
{stmt: "s := 1; a := 1.0<<s + foo_int_int(1.0<<s); _ = a", err: false},
|
||||||
{stmt: "s := 1; a := 2.0<<s + ivec2(3.0<<s); _ = a", err: false},
|
{stmt: "s := 1; a := 1.0<<s + 1.0<<s; _ = a", err: true},
|
||||||
{stmt: "s := 1; a := 2.0<<s + vec2(3); _ = a", err: true},
|
{stmt: "s := 1; a := 1<<s + 1.0<<s; _ = a", err: true},
|
||||||
{stmt: "s := 1; a := 2.0<<s + ivec2(3); _ = a", err: false},
|
{stmt: "s := 1; a := 1.0<<s + 1<<s; _ = a", err: true},
|
||||||
{stmt: "s := 1; a := 2.0<<s + foo_int_int(3.0<<s); _ = a", err: false},
|
{stmt: "s := 1; a := 1<<s + 1<<s; _ = a", err: false},
|
||||||
{stmt: "s := 1; a := 2.0<<s + 3.0<<s; _ = a", err: true},
|
{stmt: "s := 1; foo_multivar(0, 0, 1<<s)", err: false},
|
||||||
{stmt: "s := 1; a := 2<<s + 3.0<<s; _ = a", err: true},
|
{stmt: "s := 1; foo_multivar(0, 1.0<<s, 0)", err: true},
|
||||||
{stmt: "s := 1; a := 2.0<<s + 3<<s; _ = a", err: true},
|
{stmt: "s := 1; foo_multivar(1.0<<s, 0, 0)", err: false},
|
||||||
{stmt: "s := 1; a := 2<<s + 3<<s; _ = a", err: false},
|
{stmt: "s := 12; a := foo_multivar(1.0<<s, 0, 0); _ = a", err: false},
|
||||||
{stmt: "s := 1; foo_multivar(0, 0, 2<<s)", err: false},
|
{stmt: "s := 12; a := foo_multivar(0, 1.0<<s, 0); _ = a", err: true},
|
||||||
{stmt: "s := 1; foo_multivar(0, 2.0<<s, 0)", err: true},
|
{stmt: "s := 12; a := foo_multivar(0, 0, 1.0<<s); _ = a", err: false},
|
||||||
{stmt: "s := 1; foo_multivar(2.0<<s, 0, 0)", err: false},
|
|
||||||
{stmt: "s := 1; a := foo_multivar(2.0<<s, 0, 0); _ = a", err: false},
|
|
||||||
{stmt: "s := 1; a := foo_multivar(0, 2.0<<s, 0); _ = a", err: true},
|
|
||||||
{stmt: "s := 1; a := foo_multivar(0, 0, 2.0<<s); _ = a", err: false},
|
|
||||||
{stmt: "a := foo_multivar(0, 0, 1.0<<2.0); _ = a", err: false},
|
{stmt: "a := foo_multivar(0, 0, 1.0<<2.0); _ = a", err: false},
|
||||||
{stmt: "a := foo_multivar(0, 1.0<<2.0, 0); _ = a", err: false},
|
{stmt: "a := foo_multivar(0, 1.0<<2.0, 0); _ = a", err: false},
|
||||||
{stmt: "s := 1; a := int(1) + 1.0<<s + int(float(1<<s)); _ = a", err: true},
|
{stmt: "s := 12; var a int = 1.0 << 2.0 << 3.0 << 4.0 << s; _ = a", err: false},
|
||||||
{stmt: "s := 1; var a int = 1.0 << 2.0 << 3.0 << 4.0 << s; _ = a", err: false},
|
{stmt: "s := 12; var a float = 1 << 1 << 1 << 1 << s; _ = a", err: true},
|
||||||
{stmt: "s := 1; var a float = 1 << 1 << 1 << 1 << s; _ = a", err: true},
|
{stmt: "s := 12; var a float = 1 << s + 1.2; _ = a", err: true},
|
||||||
{stmt: "s := 1; var a float = 1 << s + 1.2; _ = a", err: true},
|
{stmt: "s := 12; a := 1.0 << s + 1.2; _ = a", err: true},
|
||||||
{stmt: "s := 1; a := 1.0 << s + 1.2; _ = a", err: true},
|
{stmt: "s := 12; a := 1.0 << s + foo_float_float(2); _ = a", err: true},
|
||||||
{stmt: "s := 1; a := 1.0 << s + foo_float_float(2); _ = a", err: true},
|
{stmt: "s := 12; a := 1.0 << s + foo_float_int(2); _ = a", err: false},
|
||||||
{stmt: "s := 1; a := 1.0 << s + foo_float_int(2); _ = a", err: false},
|
{stmt: "s := 12; a := foo_float_int(1.0<<s) + foo_float_int(2); _ = a", err: true},
|
||||||
{stmt: "s := 1; a := foo_float_int(1.0<<s) + foo_float_int(2); _ = a", err: true},
|
{stmt: "s := 12; a := foo_int_float(1<<s) + foo_int_float(2); _ = a", err: false},
|
||||||
{stmt: "s := 1; a := foo_int_float(1<<s) + foo_int_float(2); _ = a", err: false},
|
{stmt: "s := 12; a := foo_int_int(1<<s) + foo_int_int(2); _ = a", err: false},
|
||||||
{stmt: "s := 1; a := foo_int_int(1<<s) + foo_int_int(2); _ = a", err: false},
|
|
||||||
{stmt: "s := 1; t := 2.0; a := t + 1.0 << s; _ = a", err: true},
|
{stmt: "s := 1; t := 2.0; a := t + 1.0 << s; _ = a", err: true},
|
||||||
{stmt: "s := 1; t := 2; a := t + 1.0 << s; _ = a", err: false},
|
{stmt: "s := 1; t := 2; a := t + 1.0 << s; _ = a", err: false},
|
||||||
{stmt: "s := 1; b := 1 << s; _ = b", err: false},
|
{stmt: "s := 1; b := 1 << s; _ = b", err: false},
|
||||||
|
{stmt: "s := 1; a = 1.0 << s; _ = a", err: true},
|
||||||
|
|
||||||
{stmt: "var a = 1; b := a << 2.0; _ = b", err: false},
|
{stmt: "var a = 1; b := a << 2.0; _ = b", err: false},
|
||||||
{stmt: "s := 1; var a float; a = 1 << s; _ = a", err: true},
|
{stmt: "s := 1; var a float; a = 1 << s; _ = a", err: true},
|
||||||
{stmt: "s := 1; var a float = 1 << s; _ = a", err: true},
|
{stmt: "s := 1; var a float = 1 << s; _ = a", err: true},
|
||||||
@ -1366,6 +1363,7 @@ func TestSyntaxOperatorShift(t *testing.T) {
|
|||||||
{stmt: "s := 1; var a float = 1 << s; _ = a", err: true},
|
{stmt: "s := 1; var a float = 1 << s; _ = a", err: true},
|
||||||
{stmt: "s := 1; var a int = 1.0 << s; _ = a", err: false},
|
{stmt: "s := 1; var a int = 1.0 << s; _ = a", err: false},
|
||||||
{stmt: "s := 1; var a int = 1 << s; _ = a", err: false},
|
{stmt: "s := 1; var a int = 1 << s; _ = a", err: false},
|
||||||
|
|
||||||
{stmt: "var a float = 1.0 << 2.0; _ = a", err: false},
|
{stmt: "var a float = 1.0 << 2.0; _ = a", err: false},
|
||||||
{stmt: "var a int = 1.0 << 2; _ = a", err: false},
|
{stmt: "var a int = 1.0 << 2; _ = a", err: false},
|
||||||
{stmt: "var a float = 1.0 << 2; _ = a", err: false},
|
{stmt: "var a float = 1.0 << 2; _ = a", err: false},
|
||||||
@ -1394,81 +1392,6 @@ func TestSyntaxOperatorShift(t *testing.T) {
|
|||||||
{stmt: "a := ivec2(1) << vec2(2); _ = a", err: true},
|
{stmt: "a := ivec2(1) << vec2(2); _ = a", err: true},
|
||||||
{stmt: "a := vec3(1) << ivec2(2); _ = a", err: true},
|
{stmt: "a := vec3(1) << ivec2(2); _ = a", err: true},
|
||||||
{stmt: "a := ivec2(1) << vec3(2); _ = a", err: true},
|
{stmt: "a := ivec2(1) << vec3(2); _ = a", err: true},
|
||||||
|
|
||||||
{stmt: "b := 2.0; a := 1.0 >> 2.0 == b; _ = a", err: false},
|
|
||||||
{stmt: "s := 1; b := 2.0; a := 1.0>>s == b; _ = a", err: true},
|
|
||||||
{stmt: "s := 1; b := 2; a := 1.0>>s == b; _ = a", err: false},
|
|
||||||
{stmt: "s := 1; a := 2.0>>s + ivec2(3.0>>s); _ = a", err: false},
|
|
||||||
{stmt: "s := 1; a := 2.0>>s + vec2(3); _ = a", err: true},
|
|
||||||
{stmt: "s := 1; a := 2.0>>s + ivec2(3); _ = a", err: false},
|
|
||||||
{stmt: "s := 1; a := 2.0>>s + foo_int_int(3.0>>s); _ = a", err: false},
|
|
||||||
{stmt: "s := 1; a := 2.0>>s + 3.0>>s; _ = a", err: true},
|
|
||||||
{stmt: "s := 1; a := 2>>s + 3.0>>s; _ = a", err: true},
|
|
||||||
{stmt: "s := 1; a := 2.0>>s + 3>>s; _ = a", err: true},
|
|
||||||
{stmt: "s := 1; a := 2>>s + 3>>s; _ = a", err: false},
|
|
||||||
{stmt: "s := 1; foo_multivar(0, 0, 2>>s)", err: false},
|
|
||||||
{stmt: "s := 1; foo_multivar(0, 2.0>>s, 0)", err: true},
|
|
||||||
{stmt: "s := 1; foo_multivar(2.0>>s, 0, 0)", err: false},
|
|
||||||
{stmt: "s := 1; a := foo_multivar(2.0>>s, 0, 0); _ = a", err: false},
|
|
||||||
{stmt: "s := 1; a := foo_multivar(0, 2.0>>s, 0); _ = a", err: true},
|
|
||||||
{stmt: "s := 1; a := foo_multivar(0, 0, 2.0>>s); _ = a", err: false},
|
|
||||||
{stmt: "a := foo_multivar(0, 0, 1.0>>2.0); _ = a", err: false},
|
|
||||||
{stmt: "a := foo_multivar(0, 1.0>>2.0, 0); _ = a", err: false},
|
|
||||||
{stmt: "s := 1; a := int(1) + 1.0>>s + int(float(1>>s)); _ = a", err: true},
|
|
||||||
{stmt: "s := 1; var a int = 1.0 >> 2.0 >> 3.0 >> 4.0 >> s; _ = a", err: false},
|
|
||||||
{stmt: "s := 1; var a float = 1 >> 1 >> 1 >> 1 >> s; _ = a", err: true},
|
|
||||||
{stmt: "s := 1; var a float = 1 >> s + 1.2; _ = a", err: true},
|
|
||||||
{stmt: "s := 1; a := 1.0 >> s + 1.2; _ = a", err: true},
|
|
||||||
{stmt: "s := 1; a := 1.0 >> s + foo_float_float(2); _ = a", err: true},
|
|
||||||
{stmt: "s := 1; a := 1.0 >> s + foo_float_int(2); _ = a", err: false},
|
|
||||||
{stmt: "s := 1; a := foo_float_int(1.0>>s) + foo_float_int(2); _ = a", err: true},
|
|
||||||
{stmt: "s := 1; a := foo_int_float(1>>s) + foo_int_float(2); _ = a", err: false},
|
|
||||||
{stmt: "s := 1; a := foo_int_int(1>>s) + foo_int_int(2); _ = a", err: false},
|
|
||||||
{stmt: "s := 1; t := 2.0; a := t + 1.0 >> s; _ = a", err: true},
|
|
||||||
{stmt: "s := 1; t := 2; a := t + 1.0 >> s; _ = a", err: false},
|
|
||||||
{stmt: "s := 1; b := 1 >> s; _ = b", err: false},
|
|
||||||
{stmt: "var a = 1; b := a >> 2.0; _ = b", err: false},
|
|
||||||
{stmt: "s := 1; var a float; a = 1 >> s; _ = a", err: true},
|
|
||||||
{stmt: "s := 1; var a float = 1 >> s; _ = a", err: true},
|
|
||||||
{stmt: "s := 1; var a float = float(1.0 >> s); _ = a", err: true},
|
|
||||||
{stmt: "s := 1; var a int = int(1 >> s); _ = a", err: false},
|
|
||||||
{stmt: "s := 1; var a int = int(1.0 >> s); _ = a", err: false},
|
|
||||||
{stmt: "s := 1; a := 1 >> s; _ = a", err: false},
|
|
||||||
{stmt: "s := 1; a := 1.0 >> s; _ = a", err: true},
|
|
||||||
{stmt: "s := 1; a := int(1.0 >> s); _ = a", err: false},
|
|
||||||
{stmt: "s := 1; var a float = float(1.0 >> s); _ = a", err: true},
|
|
||||||
{stmt: "s := 1; var a float = 1.0 >> s; _ = a", err: true},
|
|
||||||
{stmt: "s := 1; var a float = 1 >> s; _ = a", err: true},
|
|
||||||
{stmt: "s := 1; var a int = 1.0 >> s; _ = a", err: false},
|
|
||||||
{stmt: "s := 1; var a int = 1 >> s; _ = a", err: false},
|
|
||||||
{stmt: "var a float = 1.0 >> 2.0; _ = a", err: false},
|
|
||||||
{stmt: "var a int = 1.0 >> 2; _ = a", err: false},
|
|
||||||
{stmt: "var a float = 1.0 >> 2; _ = a", err: false},
|
|
||||||
{stmt: "a := 1 >> 2.0; _ = a", err: false},
|
|
||||||
{stmt: "a := 1.0 >> 2; _ = a", err: false},
|
|
||||||
{stmt: "a := 1.0 >> 2.0; _ = a", err: false},
|
|
||||||
{stmt: "a := 1 >> 2; _ = a", err: false},
|
|
||||||
{stmt: "a := float(1.0) >> 2; _ = a", err: true},
|
|
||||||
{stmt: "a := 1 >> float(2.0); _ = a", err: false},
|
|
||||||
{stmt: "a := 1.0 >> float(2.0); _ = a", err: false},
|
|
||||||
{stmt: "a := ivec2(1) >> 2; _ = a", err: false},
|
|
||||||
{stmt: "a := 1 >> ivec2(2); _ = a", err: true},
|
|
||||||
{stmt: "a := ivec2(1) >> float(2.0); _ = a", err: true},
|
|
||||||
{stmt: "a := float(1.0) >> ivec2(2); _ = a", err: true},
|
|
||||||
{stmt: "a := ivec2(1) >> ivec2(2); _ = a", err: false},
|
|
||||||
{stmt: "a := ivec3(1) >> ivec2(2); _ = a", err: true},
|
|
||||||
{stmt: "a := ivec2(1) >> ivec3(2); _ = a", err: true},
|
|
||||||
{stmt: "a := 1 >> vec2(2); _ = a", err: true},
|
|
||||||
{stmt: "a := vec2(1) >> 2; _ = a", err: true},
|
|
||||||
{stmt: "a := float(1.0) >> vec2(2); _ = a", err: true},
|
|
||||||
{stmt: "a := vec2(1) >> float(2.0); _ = a", err: true},
|
|
||||||
{stmt: "a := vec2(1) >> vec2(2); _ = a", err: true},
|
|
||||||
{stmt: "a := vec2(1) >> vec3(2); _ = a", err: true},
|
|
||||||
{stmt: "a := vec3(1) >> vec2(2); _ = a", err: true},
|
|
||||||
{stmt: "a := vec2(1) >> ivec2(2); _ = a", err: true},
|
|
||||||
{stmt: "a := ivec2(1) >> vec2(2); _ = a", err: true},
|
|
||||||
{stmt: "a := vec3(1) >> ivec2(2); _ = a", err: true},
|
|
||||||
{stmt: "a := ivec2(1) >> vec3(2); _ = a", err: true},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, c := range cases {
|
for _, c := range cases {
|
||||||
|
Loading…
Reference in New Issue
Block a user