Skip to content

Commit

Permalink
Fixes os.date test that will work across timezones
Browse files Browse the repository at this point in the history
  • Loading branch information
davydog187 authored and rvirding committed Sep 27, 2024
1 parent 5b2687f commit cc3b411
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/lib_os_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ os_date_table(_) ->
os_date_integrated(_) ->
State = luerl:init(),
Chunk = <<"return os.date('noformat'), os.date(), os.date('%c', 1683371767)">>,
{[NoFormat, _, _FromTimeStamp], _State1} = luerl:do(Chunk, State),
?assertEqual(<<"noformat">>, NoFormat).
%% ?assertEqual(<<"Sat May 6 13:16:07 2023">>, FromTimeStamp).
{[NoFormat, _, FromTimeStamp], _State1} = luerl:do(Chunk, State),
?assertEqual(<<"noformat">>, NoFormat),
%% Date is "Sat May 6 13:16:07 2023",
%% Just check year to avoid test flakiness
?assert(re:run(FromTimeStamp, <<"2023">>) =/= nomatch).

os_date_integrated_table(_) ->
State = luerl:init(),
Expand Down

0 comments on commit cc3b411

Please sign in to comment.