Added more tests
This commit is contained in:
parent
77ccb8778f
commit
c19ad24428
@ -7,7 +7,7 @@ import (
|
|||||||
"git.akyoto.dev/go/assert"
|
"git.akyoto.dev/go/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestJump8(t *testing.T) {
|
func TestJump(t *testing.T) {
|
||||||
usagePatterns := []struct {
|
usagePatterns := []struct {
|
||||||
Offset int8
|
Offset int8
|
||||||
Code []byte
|
Code []byte
|
||||||
@ -29,3 +29,12 @@ func TestJump8(t *testing.T) {
|
|||||||
assert.DeepEqual(t, code, pattern.Code)
|
assert.DeepEqual(t, code, pattern.Code)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestConditionalJump(t *testing.T) {
|
||||||
|
assert.DeepEqual(t, x64.Jump8IfEqual(nil, 1), []byte{0x74, 0x01})
|
||||||
|
assert.DeepEqual(t, x64.Jump8IfNotEqual(nil, 1), []byte{0x75, 0x01})
|
||||||
|
assert.DeepEqual(t, x64.Jump8IfLess(nil, 1), []byte{0x7C, 0x01})
|
||||||
|
assert.DeepEqual(t, x64.Jump8IfGreaterOrEqual(nil, 1), []byte{0x7D, 0x01})
|
||||||
|
assert.DeepEqual(t, x64.Jump8IfLessOrEqual(nil, 1), []byte{0x7E, 0x01})
|
||||||
|
assert.DeepEqual(t, x64.Jump8IfGreater(nil, 1), []byte{0x7F, 0x01})
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user