commit d0a82f2305c005453eda82b8960e5ac8c831c285
parent 556b22ca94a15b427af591a3aa38b8a9c9ff1661
Author: lash <dev@holbrook.no>
Date: Fri, 6 Sep 2024 00:01:56 +0100
Amend cache tests
Diffstat:
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/cache/cache_test.go b/cache/cache_test.go
@@ -54,13 +54,25 @@ func TestStateDownUp(t *testing.T) {
if err != nil {
t.Error(err)
}
+ l := len(ca.Cache)
+ if l != 1 {
+ t.Fatalf("expected cache length 1, got %d", l)
+ }
err = ca.Pop()
if err != nil {
t.Error(err)
}
+ l = len(ca.Cache)
+ if l != 1 {
+ t.Fatalf("expected cache length 1, got %d", l)
+ }
err = ca.Pop()
- if err == nil {
- t.Errorf("expected out of top frame error")
+ if err != nil {
+ t.Errorf("unexpected out of top frame error")
+ }
+ l = len(ca.Cache)
+ if l != 1 {
+ t.Fatalf("expected cache length 1, got %d", l)
}
}