diff -r 116c86db7e17 -r fd84e0fb26d8 unittests/tests/utils.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/unittests/tests/utils.js Wed Nov 16 11:20:52 2011 +0100 @@ -0,0 +1,12 @@ +function test_utils() { + module("Utility function tests"); + + test("test function to convert from seconds to a time", function() { + var h = 13, m = 7, s = 41; + var t = 13 * 3600 + 7* 60 + 41; + deepEqual(IriSP.secondsToTime(t), [h, m, s], "the converted time is correct"); + + t = -t; + deepEqual(IriSP.secondsToTime(t), [h, m, s], "the function is immune to negative numbers."); + }); +} \ No newline at end of file