Fix values

This commit is contained in:
Neemek 2025-03-16 20:09:36 +01:00
parent ae7d6c5359
commit 5edad332cd
Signed by: neemek
GPG key ID: 28360A8951CD0E9B
19 changed files with 611 additions and 331 deletions

View file

@ -16,7 +16,7 @@ func GetAllTestCases() map[string]AllTestCase {
[]Value{
&VariableValue{
"a",
NumberValue(1),
&NumberValue{1},
0,
},
},
@ -26,7 +26,7 @@ func GetAllTestCases() map[string]AllTestCase {
[]Value{
&VariableValue{
"sum",
FunctionValue{
&FunctionValue{
Name: "sum",
Params: []string{"a", "b"},
Chunk: &Chunk{
@ -38,7 +38,7 @@ func GetAllTestCases() map[string]AllTestCase {
InstructionReturn,
InstructionAscend,
},
Constants: []Value{StringValue("a"), StringValue("b")},
Constants: []Value{&StringValue{"a"}, &StringValue{"b"}},
},
},
0,
@ -86,7 +86,7 @@ func TestAll(t *testing.T) {
vm := NewVM(c.Chunk, 256, 256)
t.Log("Running bytecode")
for vm.HasNext() && vm.Next() {
for vm.Next() {
}
t.Log("Comparing stacks")
@ -112,7 +112,7 @@ func BenchmarkAll(b *testing.B) {
vm := NewVM(c.Chunk, 256, 256)
for vm.HasNext() && vm.Next() {
for vm.Next() {
}
}
})