From: Ian Remmel Date: Thu, 12 Sep 2013 13:06:53 +0000 (-0400) Subject: added test to demonstrate <24 hours in addition to >24 hours X-Git-Tag: 2.3.0~41^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=478b0643ef2eae95421af3d397a6f6aad4ba719a;p=thirdparty%2Fmoment.git added test to demonstrate <24 hours in addition to >24 hours --- diff --git a/test/moment/duration.js b/test/moment/duration.js index ed0605afb..7a9ef5462 100644 --- a/test/moment/duration.js +++ b/test/moment/duration.js @@ -150,7 +150,18 @@ exports.duration = { test.done(); }, - "instantiation from 24-hour time" : function (test) { + "instantiation from 24-hour time <24 hours" : function (test) { + test.expect(6); + test.equal(moment.duration("06:45").years(), 0, "0 years"); + test.equal(moment.duration("06:45").days(), 0, "0 days"); + test.equal(moment.duration("06:45").hours(), 6, "6 hours"); + test.equal(moment.duration("06:45").minutes(), 45, "45 minutes"); + test.equal(moment.duration("06:45").seconds(), 0, "0 seconds"); + test.equal(moment.duration("06:45").milliseconds(), 0, "0 milliseconds"); + test.done(); + }, + + "instantiation from 24-hour time >24 hours" : function (test) { test.expect(6); test.equal(moment.duration("26:45").years(), 0, "0 years"); test.equal(moment.duration("26:45").days(), 1, "0 days");