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" {...@@ -1375,7 +1375,7 @@ test "cache file and then recall it" {
1375 ch.hash.add(true);1375 ch.hash.add(true);
1376 ch.hash.add(@as(u16, 1234));1376 ch.hash.add(@as(u16, 1234));
1377 ch.hash.addBytes("1234");1377 ch.hash.addBytes("1234");
1378 _ = try ch.addFile(temp_file, null);1378 _ = try ch.addFilePath(.initCwd(temp_file), null);
13791379
1380 // There should be nothing in the cache1380 // There should be nothing in the cache
1381 try testing.expectEqual(false, try ch.hit(.none));1381 try testing.expectEqual(false, try ch.hit(.none));
...@@ -1390,7 +1390,7 @@ test "cache file and then recall it" {...@@ -1390,7 +1390,7 @@ test "cache file and then recall it" {
1390 ch.hash.add(true);1390 ch.hash.add(true);
1391 ch.hash.add(@as(u16, 1234));1391 ch.hash.add(@as(u16, 1234));
1392 ch.hash.addBytes("1234");1392 ch.hash.addBytes("1234");
1393 _ = try ch.addFile(temp_file, null);1393 _ = try ch.addFilePath(.initCwd(temp_file), null);
13941394
1395 // Cache hit! We just "built" the same file1395 // Cache hit! We just "built" the same file
1396 try testing.expect(try ch.hit(.none));1396 try testing.expect(try ch.hit(.none));
...@@ -1443,7 +1443,7 @@ test "check that changing a file makes cache fail" {...@@ -1443,7 +1443,7 @@ test "check that changing a file makes cache fail" {
1443 defer ch.deinit();1443 defer ch.deinit();
14441444
1445 ch.hash.addBytes("1234");1445 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
1448 // There should be nothing in the cache1448 // There should be nothing in the cache
1449 try testing.expectEqual(false, try ch.hit(.none));1449 try testing.expectEqual(false, try ch.hit(.none));
...@@ -1462,7 +1462,7 @@ test "check that changing a file makes cache fail" {...@@ -1462,7 +1462,7 @@ test "check that changing a file makes cache fail" {
1462 defer ch.deinit();1462 defer ch.deinit();
14631463
1464 ch.hash.addBytes("1234");1464 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
1467 // A file that we depend on has been updated, so the cache should not contain an entry for it1467 // A file that we depend on has been updated, so the cache should not contain an entry for it
1468 try testing.expectEqual(false, try ch.hit(.none));1468 try testing.expectEqual(false, try ch.hit(.none));
...@@ -1570,7 +1570,7 @@ test "Manifest with files added after initial hash work" {...@@ -1570,7 +1570,7 @@ test "Manifest with files added after initial hash work" {
1570 defer ch.deinit();1570 defer ch.deinit();
15711571
1572 ch.hash.addBytes("1234");1572 ch.hash.addBytes("1234");
1573 _ = try ch.addFile(temp_file1, null);1573 _ = try ch.addFilePath(.initCwd(temp_file1), null);
15741574
1575 // There should be nothing in the cache1575 // There should be nothing in the cache
1576 try testing.expectEqual(false, try ch.hit(.none));1576 try testing.expectEqual(false, try ch.hit(.none));
...@@ -1585,7 +1585,7 @@ test "Manifest with files added after initial hash work" {...@@ -1585,7 +1585,7 @@ test "Manifest with files added after initial hash work" {
1585 defer ch.deinit();1585 defer ch.deinit();
15861586
1587 ch.hash.addBytes("1234");1587 ch.hash.addBytes("1234");
1588 _ = try ch.addFile(temp_file1, null);1588 _ = try ch.addFilePath(.initCwd(temp_file1), null);
15891589
1590 try testing.expect(try ch.hit(.none));1590 try testing.expect(try ch.hit(.none));
1591 digest2 = ch.final();1591 digest2 = ch.final();
...@@ -1608,7 +1608,7 @@ test "Manifest with files added after initial hash work" {...@@ -1608,7 +1608,7 @@ test "Manifest with files added after initial hash work" {
1608 defer ch.deinit();1608 defer ch.deinit();
16091609
1610 ch.hash.addBytes("1234");1610 ch.hash.addBytes("1234");
1611 _ = try ch.addFile(temp_file1, null);1611 _ = try ch.addFilePath(.initCwd(temp_file1), null);
16121612
1613 // A file that we depend on has been updated, so the cache should not contain an entry for it1613 // A file that we depend on has been updated, so the cache should not contain an entry for it
1614 try testing.expectEqual(false, try ch.hit(.none));1614 try testing.expectEqual(false, try ch.hit(.none));