From 4fc7a552ca6bc1638ebe6926b9f3903d8098dbde Mon Sep 17 00:00:00 2001 From: John Schmidt Date: Thu, 25 Jan 2024 21:45:12 +0100 Subject: [PATCH] explicit load --- src/test.zig | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/test.zig b/src/test.zig index 88abe5b..b5b8871 100644 --- a/src/test.zig +++ b/src/test.zig @@ -34,12 +34,10 @@ const TmpDb = struct { } fn linkDb(self: *Self) LinkDb { - self.loadFiles(); return main.LinkDb{ .allocator = allocator, .file = self.files.?.links }; } fn chainDb(self: *Self) ChainDb { - self.loadFiles(); return main.ChainDb{ .allocator = allocator, .file = self.files.?.chains, .show = .all }; } @@ -77,6 +75,9 @@ test "basic" { try runCommand(db.path, arg); } + db.loadFiles(); + defer db.unloadFiles(); + var chain_db = db.chainDb(); try chain_db.materialize(); const meta = chain_db.meta; @@ -124,6 +125,7 @@ test "linking same day twice" { } { + db.loadFiles(); defer db.unloadFiles(); var link_db = db.linkDb(); @@ -137,6 +139,9 @@ test "linking same day twice" { try runCommand(db.path, "link 1 20240101"); { + db.loadFiles(); + defer db.unloadFiles(); + var link_db = db.linkDb(); try link_db.materialize(1);