go-vise

Constrained Size Output Virtual Machine
Info | Log | Files | Refs | README | LICENSE

commit 5769abf3366f78392dd9ad59607fde3bfe3e63b3
parent 39b8e4e6b7a6be892be740d3ede34d4d3ccc3b35
Author: lash <dev@holbrook.no>
Date:   Fri, 20 Sep 2024 23:16:12 +0100

Add regression test for engine persist on finish

Diffstat:
Mengine/db_test.go | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/engine/db_test.go b/engine/db_test.go @@ -249,6 +249,19 @@ func TestDbEnginePersist(t *testing.T) { if err != nil { t.Fatal(err) } + + en = NewEngine(cfg, rs) + pe = persist.NewPersister(store) + en = NewEngine(cfg, rs) + en = en.WithPersister(pe) + cont, err = en.Exec(ctx, []byte{}) + if err != nil { + t.Fatal(err) + } + stn := pe.GetState() + if !stn.MatchFlag(state.FLAG_USERSTART, true) { + t.Fatalf("expected userstart set, have state %v", stn) + } } func TestDbEngineDebug(t *testing.T) { @@ -390,3 +403,4 @@ func TestDbFirst(t *testing.T) { t.Fatal("expected flag set") } } +