| ... | ... | @@ -271,7 +271,9 @@ test "timestamp" { |
| 271 | 271 | sleep(ns_per_ms); |
| 272 | 272 | const time_1 = milliTimestamp(); |
| 273 | 273 | const interval = time_1 - time_0; |
| 274 | | testing.expect(interval > 0 and interval < margin); |
| 274 | testing.expect(interval > 0); |
| 275 | // Tests should not depend on timings: skip test if outside margin. |
| 276 | if (!(interval < margin)) return error.SkipZigTest; |
| 275 | 277 | } |
| 276 | 278 | |
| 277 | 279 | test "Timer" { |
| ... | ... | @@ -280,7 +282,9 @@ test "Timer" { |
| 280 | 282 | var timer = try Timer.start(); |
| 281 | 283 | sleep(10 * ns_per_ms); |
| 282 | 284 | const time_0 = timer.read(); |
| 283 | | testing.expect(time_0 > 0 and time_0 < margin); |
| 285 | testing.expect(time_0 > 0); |
| 286 | // Tests should not depend on timings: skip test if outside margin. |
| 287 | if (!(time_0 < margin)) return error.SkipZigTest; |
| 284 | 288 | |
| 285 | 289 | const time_1 = timer.lap(); |
| 286 | 290 | testing.expect(time_1 >= time_0); |