@@ -43,3 +43,30 @@ local_to_utc_funkyDST_test_() ->
43
43
, ? _assertMatch ({{1951 ,9 ,7 },{17 ,0 ,0 }}, ezic :local_to_utc ({{1951 ,9 ,8 },{2 ,0 ,0 }}, " Asia/Tokyo" )) % % DST off for the last time
44
44
, ? _assertMatch ({{1952 ,5 ,3 },{17 ,0 ,0 }}, ezic :local_to_utc ({{1952 ,5 ,4 },{2 ,0 ,0 }}, " Asia/Tokyo" )) % % ensure DST not in effect for 1952
45
45
].
46
+
47
+ has_dst_local_test_ () ->
48
+ [
49
+ ? _assertMatch (false , ezic :has_dst_local ({{1998 ,3 ,1 },{1 ,30 ,0 }}, " Europe/Paris" )),
50
+ ? _assertMatch (true , ezic :has_dst_local ({{1998 ,9 ,30 },{1 ,30 ,0 }}, " Europe/Paris" )),
51
+ ? _assertMatch (true , ezic :has_dst_local ({{1998 ,8 ,30 },{3 ,30 ,0 }}, " America/Denver" )),
52
+ ? _assertMatch (false , ezic :has_dst_local ({{1998 ,10 ,30 },{3 ,30 ,0 }}, " America/Denver" )),
53
+ % % weird date
54
+ ? _assertMatch (false , ezic :has_dst_local ({{1998 ,2 ,31 },{10 ,30 ,0 }}, " Europe/Paris" )),
55
+ % % invalid zone
56
+ ? _assertException (error , {case_clause , {error , no_zone }}, ezic :has_dst_local ({{1998 ,10 ,20 },{12 ,30 ,0 }}, " non_existent" )),
57
+ % % ambiguous zone
58
+ ? _assertException (error , {case_clause , {error , {ambiguous_zone , _ }}}, ezic :has_dst_local ({{1998 ,10 ,25 },{1 ,30 ,0 }}, " America/Denver" ))
59
+ ].
60
+
61
+ has_dst_utc_test_ () ->
62
+ [
63
+ ? _assertMatch (false , ezic :has_dst_utc ({{1998 ,3 ,28 },{13 ,30 ,0 }}, " Europe/Paris" )),
64
+ ? _assertMatch (true , ezic :has_dst_utc ({{1998 ,3 ,29 },{1 ,30 ,0 }}, " Europe/Paris" )),
65
+ ? _assertMatch (true , ezic :has_dst_utc ({{1998 ,10 ,25 },{7 ,59 ,59 }}, " America/Denver" )),
66
+ ? _assertMatch (false , ezic :has_dst_utc ({{1998 ,10 ,25 },{8 ,0 ,0 }}, " America/Denver" )),
67
+ % % weird date
68
+ ? _assertMatch (false , ezic :has_dst_utc ({{1998 ,2 ,31 },{13 ,30 ,0 }}, " Europe/Paris" )),
69
+ % % invalid zone
70
+ ? _assertException (error , {case_clause , {error , no_zone }}, ezic :has_dst_utc ({{1998 ,10 ,25 },{1 ,30 ,0 }}, " non_existent" ))
71
+ ].
72
+
0 commit comments