vm/emit: emit Boolean values correctly
We should convert both `true` and `false` values.
This commit is contained in:
parent
3e54b46ffb
commit
55009153a9
9 changed files with 39 additions and 20 deletions
|
@ -361,3 +361,15 @@ func TestShortCircuit(t *testing.T) {
|
|||
eval(t, src, big.NewInt(17))
|
||||
})
|
||||
}
|
||||
|
||||
func TestEmitBoolean(t *testing.T) {
|
||||
src := `package foo
|
||||
func Main() int {
|
||||
a := true
|
||||
if (a == true) == true {
|
||||
return 42
|
||||
}
|
||||
return 11
|
||||
}`
|
||||
eval(t, src, big.NewInt(42))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue