Added SSA tests
All checks were successful
/ test (push) Successful in 17s

This commit is contained in:
Eduard Urbach 2025-06-30 13:34:15 +02:00
parent 643f17af8e
commit 1fa27dca51
Signed by: akyoto
GPG key ID: 49226B848C78F6C8
11 changed files with 221 additions and 33 deletions

23
src/ssa/Bytes_test.go Normal file
View file

@ -0,0 +1,23 @@
package ssa_test
import (
"testing"
"git.urbach.dev/cli/q/src/ssa"
"git.urbach.dev/cli/q/src/types"
"git.urbach.dev/go/assert"
)
func TestBytes(t *testing.T) {
fn := ssa.IR{}
hello := fn.Append(&ssa.Bytes{Bytes: []byte("Hello")})
world := fn.Append(&ssa.Bytes{Bytes: []byte("World")})
helloDup := fn.Append(&ssa.Bytes{Bytes: []byte("Hello")})
one := fn.AppendInt(1)
assert.False(t, hello.Equals(world))
assert.False(t, hello.Equals(one))
assert.True(t, hello.Equals(helloDup))
assert.Equal(t, hello.String(), "\"Hello\"")
assert.True(t, types.Is(hello.Type(), types.String))
}