unittests/tests/utils.js
branchpopcorn-port
changeset 252 fd84e0fb26d8
child 253 95c6b77f005e
equal deleted inserted replaced
251:116c86db7e17 252:fd84e0fb26d8
       
     1 function test_utils() {
       
     2   module("Utility function tests");
       
     3   
       
     4   test("test function to convert from seconds to a time", function() {
       
     5     var h = 13, m = 7, s = 41;
       
     6     var t = 13 * 3600 + 7* 60 + 41;
       
     7     deepEqual(IriSP.secondsToTime(t), [h, m, s], "the converted time is correct");
       
     8     
       
     9     t = -t;
       
    10     deepEqual(IriSP.secondsToTime(t), [h, m, s], "the function is immune to negative numbers.");
       
    11   });
       
    12 }