Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit bbdf6eb

Browse files
committed
[[ TimeZoneLibrary ]] Add tests
1 parent c592522 commit bbdf6eb

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
script "TimeZoneLibrary"
2+
/*
3+
Copyright (C) 2017 LiveCode Ltd.
4+
5+
This file is part of LiveCode.
6+
7+
LiveCode is free software; you can redistribute it and/or modify it under
8+
the terms of the GNU General Public License v3 as published by the Free
9+
Software Foundation.
10+
11+
LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY
12+
WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
for more details.
15+
16+
You should have received a copy of the GNU General Public License
17+
along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
18+
19+
on TestSetup
20+
TestLoadExtension "com.livecode.library.timezone"
21+
end TestSetup
22+
23+
on TestTimezoneRoundTrip
24+
local tSeconds, tRoundTrip
25+
put the seconds into tSeconds
26+
repeat for each line tZone in TimeZones()
27+
try
28+
put ToUniversalTime(FromUniversalTime(tSeconds, tZone), tZone) into tRoundTrip
29+
TestAssert tZone & "timezone round trip", tRoundTrip is tSeconds
30+
catch tError
31+
TestAssert tZone & "timezone round trip", false
32+
end try
33+
end repeat
34+
end TestTimezoneRoundTrip

0 commit comments

Comments
 (0)