authorgravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-04-14 21:34:40-06:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-05-25 13:48:43-04:00
logb67a9f2281be6712b299a4dd8bd747d8a5fda882
tree13ed59b6f019f43e5db82ff5eb2fa3310fe6b686
parentd457919ff56d9b2044cb9064dd12a32481b656bf

Switch to using `testing.expect*` in tests


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

lib/std/cache_hash.zig+6-6
...@@ -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);
362362
363 // There should be nothing in the cache363 // There should be nothing in the cache
364 debug.assert((try ch.hit()) == null);364 testing.expectEqual(@as(?[64]u8, null), try ch.hit());
365365
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);
376376
377 // Cache hit! We just "built" the same file377 // Cache hit! We just "built" the same file
378 digest2 = (try ch.hit()).?;378 digest2 = (try ch.hit()).?;
379 }379 }
380380
381 debug.assert(mem.eql(u8, digest1[0..], digest2[0..]));381 testing.expectEqual(digest1, digest2);
382382
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" {
386386
387test "give problematic timestamp" {387test "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}
391391
392test "give nonproblematic timestamp" {392test "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}