authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-08-17 22:53:49-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-08-19 12:39:37-07:00
log166cf303b260d59174fa090b3dd693ae1a7e351a
tree5bec64962eb3ff446abe9f251f105b9f6743a318
parent297774ed7c2f337e1528a99abf0e089718363768

std.Build.Cache: update unit tests to new API


1 files changed, 7 insertions(+), 7 deletions(-)

lib/std/Build/Cache.zig+7-7
......@@ -1375,7 +1375,7 @@ test "cache file and then recall it" {
13751375 ch.hash.add(true);
13761376 ch.hash.add(@as(u16, 1234));
13771377 ch.hash.addBytes("1234");
1378 _ = try ch.addFile(temp_file, null);
1378 _ = try ch.addFilePath(.initCwd(temp_file), null);
13791379
13801380 // There should be nothing in the cache
13811381 try testing.expectEqual(false, try ch.hit(.none));
......@@ -1390,7 +1390,7 @@ test "cache file and then recall it" {
13901390 ch.hash.add(true);
13911391 ch.hash.add(@as(u16, 1234));
13921392 ch.hash.addBytes("1234");
1393 _ = try ch.addFile(temp_file, null);
1393 _ = try ch.addFilePath(.initCwd(temp_file), null);
13941394
13951395 // Cache hit! We just "built" the same file
13961396 try testing.expect(try ch.hit(.none));
......@@ -1443,7 +1443,7 @@ test "check that changing a file makes cache fail" {
14431443 defer ch.deinit();
14441444
14451445 ch.hash.addBytes("1234");
1446 const temp_file_idx = try ch.addFile(temp_file, 100);
1446 const temp_file_idx = try ch.addFilePath(.initCwd(temp_file), 100);
14471447
14481448 // There should be nothing in the cache
14491449 try testing.expectEqual(false, try ch.hit(.none));
......@@ -1462,7 +1462,7 @@ test "check that changing a file makes cache fail" {
14621462 defer ch.deinit();
14631463
14641464 ch.hash.addBytes("1234");
1465 const temp_file_idx = try ch.addFile(temp_file, 100);
1465 const temp_file_idx = try ch.addFilePath(.initCwd(temp_file), 100);
14661466
14671467 // A file that we depend on has been updated, so the cache should not contain an entry for it
14681468 try testing.expectEqual(false, try ch.hit(.none));
......@@ -1570,7 +1570,7 @@ test "Manifest with files added after initial hash work" {
15701570 defer ch.deinit();
15711571
15721572 ch.hash.addBytes("1234");
1573 _ = try ch.addFile(temp_file1, null);
1573 _ = try ch.addFilePath(.initCwd(temp_file1), null);
15741574
15751575 // There should be nothing in the cache
15761576 try testing.expectEqual(false, try ch.hit(.none));
......@@ -1585,7 +1585,7 @@ test "Manifest with files added after initial hash work" {
15851585 defer ch.deinit();
15861586
15871587 ch.hash.addBytes("1234");
1588 _ = try ch.addFile(temp_file1, null);
1588 _ = try ch.addFilePath(.initCwd(temp_file1), null);
15891589
15901590 try testing.expect(try ch.hit(.none));
15911591 digest2 = ch.final();
......@@ -1608,7 +1608,7 @@ test "Manifest with files added after initial hash work" {
16081608 defer ch.deinit();
16091609
16101610 ch.hash.addBytes("1234");
1611 _ = try ch.addFile(temp_file1, null);
1611 _ = try ch.addFilePath(.initCwd(temp_file1), null);
16121612
16131613 // A file that we depend on has been updated, so the cache should not contain an entry for it
16141614 try testing.expectEqual(false, try ch.hit(.none));