commit 826c56de5470a3ad764eee96b5e0d21018618aab
parent cc90090d7cde8c021af022d436c6d67ac84c6de9
Author: lash <dev@holbrook.no>
Date: Tue, 25 Mar 2025 14:12:47 +0000
Demonstrate missing cache symbol when load fail
Diffstat:
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/vm/runner_test.go b/vm/runner_test.go
@@ -855,7 +855,6 @@ func TestErrorOut(t *testing.T) {
}
st = state.NewState(0)
- ca = cache.NewCache()
b = NewLine(nil, LOAD, []string{"aiee"}, []byte{0x01, 0x10}, nil)
b = NewLine(b, HALT, nil, nil, nil)
vm = NewVm(st, rs, ca, nil)
@@ -866,5 +865,12 @@ func TestErrorOut(t *testing.T) {
if !strings.Contains(vm.String(), ") error load: aiee") {
t.Fatalf("expected load fail aiee in vm string, got %s", vm.String())
}
-
+ _, err = ca.Get("two")
+ if err != nil {
+ t.Fatal(err)
+ }
+ _, err = ca.Get("aiee")
+ if err == nil {
+ t.Fatalf("expected error")
+ }
}