1
Fork 0
mirror of https://github.com/RGBCube/revolt.v synced 2025-07-28 09:27:45 +00:00

Add time test

This commit is contained in:
RGBCube 2022-12-16 22:35:00 +03:00
parent 5dec948e80
commit 32e7c79cef

14
src/time_test.v Normal file
View file

@ -0,0 +1,14 @@
module revolt
import time
fn test_time() {
time := Time(time.unix(1670178420))
assert time.format(.short_time) == '<t:1670178420:t>'
assert time.format(.long_time) == '<t:1670178420:T>'
assert time.format(.short_date) == '<t:1670178420:d>'
assert time.format(.long_date) == '<t:1670178420:D>'
assert time.format(.short_date_time) == '<t:1670178420:f>'
assert time.format(.long_date_time) == '<t:1670178420:F>'
assert time.format(.relative) == '<t:1670178420:R>'
}