This commit is contained in:
parent
643f17af8e
commit
1fa27dca51
11 changed files with 221 additions and 33 deletions
23
src/ssa/Bytes_test.go
Normal file
23
src/ssa/Bytes_test.go
Normal 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))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue