mirror of
https://github.com/lune-org/lune.git
synced 2025-05-04 10:43:57 +01:00
chore(tests): remove note comments
This commit is contained in:
parent
aa73a4b72e
commit
ac948b22d9
1 changed files with 5 additions and 17 deletions
|
@ -13,29 +13,17 @@ assert(
|
||||||
"expected format specifier '%A, %d %B %Y' to return 'samedi, 26 août 2023' for locale 'fr'"
|
"expected format specifier '%A, %d %B %Y' to return 'samedi, 26 août 2023' for locale 'fr'"
|
||||||
)
|
)
|
||||||
|
|
||||||
-- FIXME: Local timezone formatTime fails due to a rust side bug
|
local expectedTimeString = os.date("%Y-%m-%dT%H:%M:%SZ", 1694078954)
|
||||||
|
|
||||||
local expectedTimeString = os.date("%Y-%m-%dT%H:%M:%SZ%z", 1693932753)
|
|
||||||
|
|
||||||
-- NOTE: UTC Timezone conversions work perfectly fine, issue only for local.
|
|
||||||
-- So far I've made it so that format_time always converts to_universal_time
|
|
||||||
-- Builder object. Then in to_string, we construct a ChronoDateTime from the values
|
|
||||||
-- and convert it to the requested timezone. We then format this with our formatter
|
|
||||||
-- string.
|
|
||||||
|
|
||||||
-- For debugging, try checking what to_universal_time returns, maybe that's where
|
|
||||||
-- an incorrect DateTimeBuilder is getting returned... If that's the case, that means
|
|
||||||
-- there probably isn't any issue with to_string at all.
|
|
||||||
|
|
||||||
-- Yes, an invalid DateTimeBuilder is being returned turns out. Still don't know why actually.
|
|
||||||
|
|
||||||
print(
|
print(
|
||||||
expectedTimeString,
|
expectedTimeString,
|
||||||
DateTime.fromUnixTimestamp(1693068988):formatTime("local", "%Y-%m-%dT%H:%M:%SZ", "en")
|
DateTime.fromUnixTimestamp(1694078954):formatTime("local", "%Y-%m-%dT%H:%M:%SZ", "en")
|
||||||
)
|
)
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
DateTime.fromUnixTimestamp(1693068988):formatTime("local", "%Y-%m-%dT%H:%M:%SZ", "en")
|
DateTime.fromUnixTimestamp(1694078954):formatTime("local", "%Y-%m-%dT%H:%M:%SZ", "en")
|
||||||
== expectedTimeString,
|
== expectedTimeString,
|
||||||
"invalid ISO 8601 formatting for DateTime.formatTime() (local)"
|
"invalid ISO 8601 formatting for DateTime.formatTime() (local)"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
-- TODO: Locale tests, by using os.date()
|
||||||
|
|
Loading…
Add table
Reference in a new issue