Skip to content

Commit

Permalink
Removed test which seemed locale dependant
Browse files Browse the repository at this point in the history
  • Loading branch information
rvirding committed Jan 28, 2024
1 parent 3a93636 commit 2124269
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test/lib_os_SUITE.erl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% Copyright (c) 2019 Mark Meeus
%% Copyright (c) 2023 Mark Meeus
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,8 @@
-include_lib("eunit/include/eunit.hrl").

-export([all/0, groups/0]).
-export([os_date_formatting/1, os_date_table/1, os_date_integrated/1, os_date_integrated_table/1]).
-export([os_date_formatting/1, os_date_table/1,
os_date_integrated/1, os_date_integrated_table/1]).

all() ->
[
Expand Down Expand Up @@ -58,7 +59,7 @@ os_date_formatting(_) ->
?assertEqual(<<"PM">>, luerl_lib_os_date:format({{2023, 1, 2},{23,59,0}}, <<"%p">>)),

?assertEqual(<<"09">>, luerl_lib_os_date:format({{2023, 1, 2},{9,0,0}}, <<"%I">>)), %% Hour in 12H
?assertEqual(<<"1">>, luerl_lib_os_date:format(Date, <<"%W">>)), %% ISO Week number
?assertEqual(<<"01">>, luerl_lib_os_date:format(Date, <<"%W">>)), %% ISO Week number
?assertEqual(<<"Jan">>, luerl_lib_os_date:format(Date, <<"%b">>)),
?assertEqual(<<"January">>, luerl_lib_os_date:format(Date, <<"%B">>)),
?assertEqual(<<"Mon">>, luerl_lib_os_date:format(Date, <<"%a">>)),
Expand All @@ -75,15 +76,16 @@ os_date_table(_) ->
{<<"day">>, 2},
{<<"hour">>, 3},
{<<"min">>, 4},
{<<"sec">>, 5}
{<<"sec">>, 5},
{<<"wday">>, 2}
], luerl_lib_os_date:format(Date, <<"*t">>)).

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(<<"05/06/23 13:16:07">>, FromTimeStamp).
?assertEqual(<<"noformat">>, NoFormat).
%% ?assertEqual(<<"05/06/23 13:16:07">>, FromTimeStamp).

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

0 comments on commit 2124269

Please sign in to comment.