datetime manipulation is now much clearer. tests were added, and expectations stated explicitly in many places. rules got lots of attention.

This commit is contained in:
aj
2010-11-10 01:52:13 -08:00
parent 216a8d9ff8
commit d84a0c1822
11 changed files with 245 additions and 116 deletions

View File

@@ -12,3 +12,23 @@ split_by_name_test_() ->
, ?_assertEqual({BZones, AZones}, ezic_zone:split_by_name(B, AllZones))
, ?_assertEqual({[], AllZones}, ezic_zone:split_by_name(#zone{name=c}, AllZones))
].
project_end_test_() ->
[
?_assertEqual({{2010,11,10},{16,20,0}},
ezic_zone:project_end(
#zone{until={{2010,11,10},#tztime{time={10,20,0}, flag=w}}, gmtoff={-7,0,0}}
, {1,0,0}))
, ?_assertEqual({{2010,11,10},{16,20,0}},
ezic_zone:project_end(
#zone{until={{2010,11,10},#tztime{time={9,20,0}, flag=s}}, gmtoff={-7,0,0}}
, {1,0,0}))
, ?_assertEqual({{2010,11,10},{16,20,0}},
ezic_zone:project_end(
#zone{until={{2010,11,10},#tztime{time={16,20,0}, flag=u}}, gmtoff={-7,0,0}}
, {1,0,0}))
].