| ... | @@ -358,10 +358,10 @@ test "cache file and then recall it" { | ... | @@ -358,10 +358,10 @@ test "cache file and then recall it" { |
| 358 | ch.add(true); | 358 | ch.add(true); |
| 359 | ch.add(@as(u16, 1234)); | 359 | ch.add(@as(u16, 1234)); |
| 360 | ch.add("1234"); | 360 | ch.add("1234"); |
| 361 | try ch.addFile("test.txt"); | 361 | try ch.addFile(temp_file); |
| 362 | | 362 | |
| 363 | // There should be nothing in the cache | 363 | // There should be nothing in the cache |
| 364 | debug.assert((try ch.hit()) == null); | 364 | testing.expectEqual(@as(?[64]u8, null), try ch.hit()); |
| 365 | | 365 | |
| 366 | digest1 = ch.final(); | 366 | digest1 = ch.final(); |
| 367 | } | 367 | } |
| ... | @@ -372,13 +372,13 @@ test "cache file and then recall it" { | ... | @@ -372,13 +372,13 @@ test "cache file and then recall it" { |
| 372 | ch.add(true); | 372 | ch.add(true); |
| 373 | ch.add(@as(u16, 1234)); | 373 | ch.add(@as(u16, 1234)); |
| 374 | ch.add("1234"); | 374 | ch.add("1234"); |
| 375 | try ch.addFile("test.txt"); | 375 | try ch.addFile(temp_file); |
| 376 | | 376 | |
| 377 | // Cache hit! We just "built" the same file | 377 | // Cache hit! We just "built" the same file |
| 378 | digest2 = (try ch.hit()).?; | 378 | digest2 = (try ch.hit()).?; |
| 379 | } | 379 | } |
| 380 | | 380 | |
| 381 | debug.assert(mem.eql(u8, digest1[0..], digest2[0..])); | 381 | testing.expectEqual(digest1, digest2); |
| 382 | | 382 | |
| 383 | try cwd.deleteTree(temp_manifest_dir); | 383 | try cwd.deleteTree(temp_manifest_dir); |
| 384 | try cwd.deleteFile(temp_file); | 384 | try cwd.deleteFile(temp_file); |
| ... | @@ -386,10 +386,10 @@ test "cache file and then recall it" { | ... | @@ -386,10 +386,10 @@ test "cache file and then recall it" { |
| 386 | | 386 | |
| 387 | test "give problematic timestamp" { | 387 | test "give problematic timestamp" { |
| 388 | const now_ns = @intCast(i64, time.milliTimestamp() * time.millisecond); | 388 | const now_ns = @intCast(i64, time.milliTimestamp() * time.millisecond); |
| 389 | debug.assert(is_problematic_timestamp(now_ns)); | 389 | testing.expect(is_problematic_timestamp(now_ns)); |
| 390 | } | 390 | } |
| 391 | | 391 | |
| 392 | test "give nonproblematic timestamp" { | 392 | test "give nonproblematic timestamp" { |
| 393 | const now_ns = @intCast(i64, time.milliTimestamp() * time.millisecond) - 1000; | 393 | const now_ns = @intCast(i64, time.milliTimestamp() * time.millisecond) - 1000; |
| 394 | debug.assert(!is_problematic_timestamp(now_ns)); | 394 | testing.expect(!is_problematic_timestamp(now_ns)); |
| 395 | } | 395 | } |