diff --git a/tests/datetime/toLocalTime.luau b/tests/datetime/toLocalTime.luau index 3e79bf4..144bfbe 100644 --- a/tests/datetime/toLocalTime.luau +++ b/tests/datetime/toLocalTime.luau @@ -4,9 +4,27 @@ local values = DateTime.fromRfc3339("2023-08-27T05:54:19Z"):toLocalTime() local expectedDateTimeValues = os.date("*t", 1693115659) -assert(values.year == expectedDateTimeValues.year, `expected {values.year} == {expectedDateTimeValues.year}`) -assert(values.month == expectedDateTimeValues.month, `expected {values.month} == {expectedDateTimeValues.month}`) -assert(values.day == expectedDateTimeValues.day, `expected {values.day} == {expectedDateTimeValues.day}`) -assert(values.hour == expectedDateTimeValues.hour, `expected {values.hour} == {expectedDateTimeValues.hour}`) -assert(values.minute == expectedDateTimeValues.min, `expected {values.minute} == {expectedDateTimeValues.min}`) -assert(values.second == expectedDateTimeValues.sec, `expected {values.second} == {expectedDateTimeValues.sec}`) +assert( + values.year == expectedDateTimeValues.year, + `expected {values.year} == {expectedDateTimeValues.year}` +) +assert( + values.month == expectedDateTimeValues.month, + `expected {values.month} == {expectedDateTimeValues.month}` +) +assert( + values.day == expectedDateTimeValues.day, + `expected {values.day} == {expectedDateTimeValues.day}` +) +assert( + values.hour == expectedDateTimeValues.hour, + `expected {values.hour} == {expectedDateTimeValues.hour}` +) +assert( + values.minute == expectedDateTimeValues.min, + `expected {values.minute} == {expectedDateTimeValues.min}` +) +assert( + values.second == expectedDateTimeValues.sec, + `expected {values.second} == {expectedDateTimeValues.sec}` +) diff --git a/tests/datetime/toRfc3339.luau b/tests/datetime/toRfc3339.luau index 8424a2f..51f8fd5 100644 --- a/tests/datetime/toRfc3339.luau +++ b/tests/datetime/toRfc3339.luau @@ -10,14 +10,23 @@ local timezoneSplitIdx = string.find(nowRfc, "+") local timezoneZeroedIdx = string.find(nowRfc, "Z") assert(dateTimeSplitIdx ~= nil, "Missing date & time separator 'T' in RFC 3339 string") -assert(timezoneSplitIdx ~= nil or timezoneZeroedIdx ~= nil, "Missing timezone separator '+' or 'Z' in RFC 3339 string") +assert( + timezoneSplitIdx ~= nil or timezoneZeroedIdx ~= nil, + "Missing timezone separator '+' or 'Z' in RFC 3339 string" +) -- Split date (before T) by dashes, split time (after T, before + or Z) -- by colons, we should then get 3 substrings for each of date & time local dateParts = string.split(string.sub(nowRfc, 1, dateTimeSplitIdx - 1), "-") -local timeParts = - string.split(string.sub(nowRfc, dateTimeSplitIdx + 1, ((timezoneSplitIdx or timezoneZeroedIdx) :: number) - 1), ":") +local timeParts = string.split( + string.sub( + nowRfc, + dateTimeSplitIdx + 1, + ((timezoneSplitIdx or timezoneZeroedIdx) :: number) - 1 + ), + ":" +) assert(#dateParts == 3, "Date partial of RFC 3339 should consist of 3 substrings, separated by '-'") assert(#timeParts == 3, "Time partial of RFC 3339 should consist of 3 substrings, separated by ':'") @@ -42,13 +51,22 @@ assert( if timezoneZeroedIdx ~= nil then -- No timezone offset - assert(timezoneZeroedIdx == #nowRfc, "Timezone specifier 'Z' must be at the last character in RFC 3339 string") + assert( + timezoneZeroedIdx == #nowRfc, + "Timezone specifier 'Z' must be at the last character in RFC 3339 string" + ) elseif timezoneSplitIdx ~= nil then -- Timezone offset local timezoneParts = string.split(string.sub(nowRfc, timezoneSplitIdx + 1), ":") assert(#timezoneParts == 2, "Timezone partial should consist of 2 substings, separated by ':'") - assert(string.match(timezoneParts[1], "^%d%d$"), "Timezone partial should have 2 digits for hour") - assert(string.match(timezoneParts[2], "^%d%d$"), "Timezone partial should have 2 digits for minute") + assert( + string.match(timezoneParts[1], "^%d%d$"), + "Timezone partial should have 2 digits for hour" + ) + assert( + string.match(timezoneParts[2], "^%d%d$"), + "Timezone partial should have 2 digits for minute" + ) else error("unreachable") end diff --git a/tests/datetime/toUniversalTime.luau b/tests/datetime/toUniversalTime.luau index 3e79bf4..144bfbe 100644 --- a/tests/datetime/toUniversalTime.luau +++ b/tests/datetime/toUniversalTime.luau @@ -4,9 +4,27 @@ local values = DateTime.fromRfc3339("2023-08-27T05:54:19Z"):toLocalTime() local expectedDateTimeValues = os.date("*t", 1693115659) -assert(values.year == expectedDateTimeValues.year, `expected {values.year} == {expectedDateTimeValues.year}`) -assert(values.month == expectedDateTimeValues.month, `expected {values.month} == {expectedDateTimeValues.month}`) -assert(values.day == expectedDateTimeValues.day, `expected {values.day} == {expectedDateTimeValues.day}`) -assert(values.hour == expectedDateTimeValues.hour, `expected {values.hour} == {expectedDateTimeValues.hour}`) -assert(values.minute == expectedDateTimeValues.min, `expected {values.minute} == {expectedDateTimeValues.min}`) -assert(values.second == expectedDateTimeValues.sec, `expected {values.second} == {expectedDateTimeValues.sec}`) +assert( + values.year == expectedDateTimeValues.year, + `expected {values.year} == {expectedDateTimeValues.year}` +) +assert( + values.month == expectedDateTimeValues.month, + `expected {values.month} == {expectedDateTimeValues.month}` +) +assert( + values.day == expectedDateTimeValues.day, + `expected {values.day} == {expectedDateTimeValues.day}` +) +assert( + values.hour == expectedDateTimeValues.hour, + `expected {values.hour} == {expectedDateTimeValues.hour}` +) +assert( + values.minute == expectedDateTimeValues.min, + `expected {values.minute} == {expectedDateTimeValues.min}` +) +assert( + values.second == expectedDateTimeValues.sec, + `expected {values.second} == {expectedDateTimeValues.sec}` +) diff --git a/tests/process/create/non_blocking.luau b/tests/process/create/non_blocking.luau index 3c7b58c..bd832fc 100644 --- a/tests/process/create/non_blocking.luau +++ b/tests/process/create/non_blocking.luau @@ -5,4 +5,7 @@ local childThread = coroutine.create(process.create) local ok, err = coroutine.resume(childThread, "echo", { "hello, world" }) assert(ok, err) -assert(coroutine.status(childThread) == "dead", "Child process should not yield the thread it is created on") +assert( + coroutine.status(childThread) == "dead", + "Child process should not yield the thread it is created on" +) diff --git a/types/datetime.luau b/types/datetime.luau index 4013e2c..61e61cf 100644 --- a/types/datetime.luau +++ b/types/datetime.luau @@ -163,7 +163,11 @@ end @param locale -- The locale the time should be formatted in @return string -- The formatting string ]=] -function DateTime.formatUniversalTime(self: DateTime, formatString: string?, locale: Locale?): string +function DateTime.formatUniversalTime( + self: DateTime, + formatString: string?, + locale: Locale? +): string return nil :: any end diff --git a/types/serde.luau b/types/serde.luau index cd2658d..fa9923e 100644 --- a/types/serde.luau +++ b/types/serde.luau @@ -139,7 +139,11 @@ end @param level The compression level to use, clamped to the format's limits. The best compression level is used by default @return The compressed string ]=] -function serde.compress(format: CompressDecompressFormat, s: buffer | string, level: number?): string +function serde.compress( + format: CompressDecompressFormat, + s: buffer | string, + level: number? +): string return nil :: any end diff --git a/types/stdio.luau b/types/stdio.luau index 06ebc27..a5004fe 100644 --- a/types/stdio.luau +++ b/types/stdio.luau @@ -1,4 +1,13 @@ -export type Color = "reset" | "black" | "red" | "green" | "yellow" | "blue" | "purple" | "cyan" | "white" +export type Color = + "reset" + | "black" + | "red" + | "green" + | "yellow" + | "blue" + | "purple" + | "cyan" + | "white" export type Style = "reset" | "bold" | "dim" type PromptFn = (