| ... | @@ -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); |
| 1379 | | 1379 | |
| 1380 | // There should be nothing in the cache | 1380 | // 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); |
| 1394 | | 1394 | |
| 1395 | // Cache hit! We just "built" the same file | 1395 | // 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(); |
| 1444 | | 1444 | |
| 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); |
| 1447 | | 1447 | |
| 1448 | // There should be nothing in the cache | 1448 | // 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(); |
| 1463 | | 1463 | |
| 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); |
| 1466 | | 1466 | |
| 1467 | // A file that we depend on has been updated, so the cache should not contain an entry for it | 1467 | // 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(); |
| 1571 | | 1571 | |
| 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); |
| 1574 | | 1574 | |
| 1575 | // There should be nothing in the cache | 1575 | // 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(); |
| 1586 | | 1586 | |
| 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); |
| 1589 | | 1589 | |
| 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(); |
| 1609 | | 1609 | |
| 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); |
| 1612 | | 1612 | |
| 1613 | // A file that we depend on has been updated, so the cache should not contain an entry for it | 1613 | // 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)); |