unittests/tests/utils.js
branchpopcorn-port
changeset 256 8e1181b855bd
parent 254 cafaa694b709
child 285 b7aa28af2c10
equal deleted inserted replaced
255:af3adcf7cb20 256:8e1181b855bd
    22     var total = -total;    
    22     var total = -total;    
    23     
    23     
    24     equal(IriSP.timeToPourcent(2, 3), 66, "the function is immune to negative numbers");            
    24     equal(IriSP.timeToPourcent(2, 3), 66, "the function is immune to negative numbers");            
    25   });
    25   });
    26   
    26   
       
    27   test("test padding function", function() {
       
    28     equal(IriSP.padWithZeros(3), "03", "function works correctly");
       
    29   });
       
    30   
    27   test("test function to convert from seconds to a time", function() {
    31   test("test function to convert from seconds to a time", function() {
    28     var h = 13, m = 7, s = 41;
    32     var h = 13, m = 7, s = 41;
    29     var t = 13 * 3600 + 7* 60 + 41;
    33     var t = 13 * 3600 + 7* 60 + 41;
    30     deepEqual(IriSP.secondsToTime(t), {"hours" : h, "minutes" : m, "seconds" : s}, 
    34     deepEqual(IriSP.secondsToTime(t), {"hours" : h, "minutes" : m, "seconds" : s}, 
    31               "the converted time is correct");
    35               "the converted time is correct");