1
1
mirror of https://github.com/ariya/phantomjs.git synced 2024-09-11 12:55:33 +03:00

Make test suite timezone-independent.

And to enforce this, run all the tests in a fixed, unusual time zone from
now on.
This commit is contained in:
Zack Weinberg 2015-12-11 11:48:07 -05:00
parent 0531412a71
commit e9c530a842
2 changed files with 15 additions and 2 deletions

View File

@ -993,6 +993,19 @@ def init():
sys.stdout.write(colorize("b", "## Testing PhantomJS "+ver[0])+"\n")
# Run all the tests in Chatham Islands Standard Time, UTC+12:45.
# This timezone is deliberately chosen to be unusual: it's not a
# whole number of hours offset from UTC *and* it's more than twelve
# hours offset from UTC.
#
# The Chatham Islands do observe daylight savings, but we don't
# implement that because testsuite issues only reproducible on two
# particular days out of the year are too much tsuris.
#
# Note that the offset in a TZ value is the negative of the way it's
# usually written, e.g. UTC+1 would be xxx-1:00.
os.environ["TZ"] = "CIST-12:45:00"
return runner
def main():

View File

@ -1,8 +1,8 @@
test(function() {
var date = new Date('2012-09-07');
assert_not_equals(date.toString(), 'Invalid Date');
assert_equals(date.getDate(), 6);
assert_equals(date.getMonth(), 8);
assert_equals(date.getUTCDate(), 7);
assert_equals(date.getUTCMonth(), 8);
assert_equals(date.getYear(), 112);
}, "new Date()");