Skip to content

Commit

Permalink
Add tests for issue sharkdp#622
Browse files Browse the repository at this point in the history
  • Loading branch information
Goju-Ryu committed Nov 25, 2024
1 parent 6aa6254 commit 417244e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/tests/human.nbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ assert_eq((60.1 seconds -> human), "1 minute + 0.1 seconds")
assert_eq((1 minute -> human), "1 minute")
assert_eq((1.25 minute -> human), "1 minute + 15 seconds")
assert_eq((2.5 minute -> human), "2 minutes + 30 seconds")
assert_eq(((2 min + 59.99999 s )-> human), "3 minutes")

assert_eq((1 hour -> human), "1 hour")
assert_eq((1.5 hour -> human), "1 hour + 30 minutes")
assert_eq((2 hour -> human), "2 hours")
assert_eq((1 hour + 1 sec -> human), "1 hour + 1 second")
assert_eq((123 min -> human), "2 hours + 3 minutes")
assert_eq((1234 min -> human), "20 hours + 34 minutes")

assert_eq((1 day -> human), "1 day")
assert_eq((1.37 day -> human), "1 day + 8 hours + 52 minutes + 48 seconds")
Expand All @@ -41,7 +44,7 @@ assert_eq((1 ms -> human), "0.001 seconds")
assert_eq((1 µs -> human), "0.000001 seconds")
assert_eq((1 ns -> human), "1.0e-9 seconds")
assert_eq((1234 ns -> human), "0.000001234 seconds")
assert_eq((1s + 1234 ns -> human), "1 second")
assert_eq((1 s + 1234 ns -> human), "1 second")

assert_eq((-1 second -> human), "1 second ago")
assert_eq((-7.89 hour -> human), "7 hours + 53 minutes + 24 seconds ago")

0 comments on commit 417244e

Please sign in to comment.