diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-05-08 14:45:21 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-05-08 14:45:21 -0700 |
| commit | 5619ce2406a545e177882415195575463989066d (patch) | |
| tree | 5c0e786d19054a56ae42272713de321e25d2efc8 /src/Cache.zig | |
| parent | 5cd9afc6b6cf33f650e5afc6b726b91dfb97e697 (diff) | |
| parent | 67154d233ef68d9fd63e673e63e7d66f149060a5 (diff) | |
| download | zig-5619ce2406a545e177882415195575463989066d.tar.gz zig-5619ce2406a545e177882415195575463989066d.zip | |
Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen
Conflicts:
* doc/langref.html.in
* lib/std/enums.zig
* lib/std/fmt.zig
* lib/std/hash/auto_hash.zig
* lib/std/math.zig
* lib/std/mem.zig
* lib/std/meta.zig
* test/behavior/alignof.zig
* test/behavior/bitcast.zig
* test/behavior/bugs/1421.zig
* test/behavior/cast.zig
* test/behavior/ptrcast.zig
* test/behavior/type_info.zig
* test/behavior/vector.zig
Master branch added `try` to a bunch of testing function calls, and some
lines also had changed how to refer to the native architecture and other
`@import("builtin")` stuff.
Diffstat (limited to 'src/Cache.zig')
| -rw-r--r-- | src/Cache.zig | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/Cache.zig b/src/Cache.zig index f2fdafff9b..5bc32b4b68 100644 --- a/src/Cache.zig +++ b/src/Cache.zig @@ -727,7 +727,7 @@ test "cache file and then recall it" { _ = try ch.addFile(temp_file, null); // There should be nothing in the cache - testing.expectEqual(false, try ch.hit()); + try testing.expectEqual(false, try ch.hit()); digest1 = ch.final(); try ch.writeManifest(); @@ -742,13 +742,13 @@ test "cache file and then recall it" { _ = try ch.addFile(temp_file, null); // Cache hit! We just "built" the same file - testing.expect(try ch.hit()); + try testing.expect(try ch.hit()); digest2 = ch.final(); try ch.writeManifest(); } - testing.expectEqual(digest1, digest2); + try testing.expectEqual(digest1, digest2); } try cwd.deleteTree(temp_manifest_dir); @@ -760,11 +760,11 @@ test "give problematic timestamp" { // to make it problematic, we make it only accurate to the second fs_clock = @divTrunc(fs_clock, std.time.ns_per_s); fs_clock *= std.time.ns_per_s; - testing.expect(isProblematicTimestamp(fs_clock)); + try testing.expect(isProblematicTimestamp(fs_clock)); } test "give nonproblematic timestamp" { - testing.expect(!isProblematicTimestamp(std.time.nanoTimestamp() - std.time.ns_per_s)); + try testing.expect(!isProblematicTimestamp(std.time.nanoTimestamp() - std.time.ns_per_s)); } test "check that changing a file makes cache fail" { @@ -807,9 +807,9 @@ test "check that changing a file makes cache fail" { const temp_file_idx = try ch.addFile(temp_file, 100); // There should be nothing in the cache - testing.expectEqual(false, try ch.hit()); + try testing.expectEqual(false, try ch.hit()); - testing.expect(mem.eql(u8, original_temp_file_contents, ch.files.items[temp_file_idx].contents.?)); + try testing.expect(mem.eql(u8, original_temp_file_contents, ch.files.items[temp_file_idx].contents.?)); digest1 = ch.final(); @@ -826,17 +826,17 @@ test "check that changing a file makes cache fail" { const temp_file_idx = try ch.addFile(temp_file, 100); // A file that we depend on has been updated, so the cache should not contain an entry for it - testing.expectEqual(false, try ch.hit()); + try testing.expectEqual(false, try ch.hit()); // The cache system does not keep the contents of re-hashed input files. - testing.expect(ch.files.items[temp_file_idx].contents == null); + try testing.expect(ch.files.items[temp_file_idx].contents == null); digest2 = ch.final(); try ch.writeManifest(); } - testing.expect(!mem.eql(u8, digest1[0..], digest2[0..])); + try testing.expect(!mem.eql(u8, digest1[0..], digest2[0..])); } try cwd.deleteTree(temp_manifest_dir); @@ -868,7 +868,7 @@ test "no file inputs" { ch.hash.addBytes("1234"); // There should be nothing in the cache - testing.expectEqual(false, try ch.hit()); + try testing.expectEqual(false, try ch.hit()); digest1 = ch.final(); @@ -880,12 +880,12 @@ test "no file inputs" { ch.hash.addBytes("1234"); - testing.expect(try ch.hit()); + try testing.expect(try ch.hit()); digest2 = ch.final(); try ch.writeManifest(); } - testing.expectEqual(digest1, digest2); + try testing.expectEqual(digest1, digest2); } test "Manifest with files added after initial hash work" { @@ -926,7 +926,7 @@ test "Manifest with files added after initial hash work" { _ = try ch.addFile(temp_file1, null); // There should be nothing in the cache - testing.expectEqual(false, try ch.hit()); + try testing.expectEqual(false, try ch.hit()); _ = try ch.addFilePost(temp_file2); @@ -940,12 +940,12 @@ test "Manifest with files added after initial hash work" { ch.hash.addBytes("1234"); _ = try ch.addFile(temp_file1, null); - testing.expect(try ch.hit()); + try testing.expect(try ch.hit()); digest2 = ch.final(); try ch.writeManifest(); } - testing.expect(mem.eql(u8, &digest1, &digest2)); + try testing.expect(mem.eql(u8, &digest1, &digest2)); // Modify the file added after initial hash const ts2 = std.time.nanoTimestamp(); @@ -963,7 +963,7 @@ test "Manifest with files added after initial hash work" { _ = try ch.addFile(temp_file1, null); // A file that we depend on has been updated, so the cache should not contain an entry for it - testing.expectEqual(false, try ch.hit()); + try testing.expectEqual(false, try ch.hit()); _ = try ch.addFilePost(temp_file2); @@ -972,7 +972,7 @@ test "Manifest with files added after initial hash work" { try ch.writeManifest(); } - testing.expect(!mem.eql(u8, &digest1, &digest3)); + try testing.expect(!mem.eql(u8, &digest1, &digest3)); } try cwd.deleteTree(temp_manifest_dir); |
