Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test time fail #3

Closed
Troush opened this issue May 27, 2014 · 0 comments
Closed

Test time fail #3

Troush opened this issue May 27, 2014 · 0 comments

Comments

@Troush
Copy link

Troush commented May 27, 2014

PASSED test: Test_isInt 0 ms
_AssertFailure: doh._AssertFailure: assertEqual() failed:
expected
Sun Feb 05 2012 05:11:40 GMT+0100 (CET)
but got
Sun Feb 05 2012 06:11:40 GMT+0200 (EET)

<<<
doh._AssertFailure stack>
doh._AssertFailure
at Object.d as runnerFactory
at /home/troush/Work/ufoJS/env/javascript/tests-node.js:26:15
at Object.context.execCb (/home/troush/Work/ufoJS/env/javascript/r.js:1764:33)
at Object.Module.check (/home/troush/Work/ufoJS/env/javascript/r.js:1073:51)
at Object.Module.enable (/home/troush/Work/ufoJS/env/javascript/r.js:1314:22)
at Object.Module.init (/home/troush/Work/ufoJS/env/javascript/r.js:972:26)
at Object.context.require (/home/troush/Work/ufoJS/env/javascript/r.js:1569:28)
at requirejs (/home/troush/Work/ufoJS/env/javascript/r.js:1848:24)
at /home/troush/Work/ufoJS/env/javascript/tests-node.js:2:1
at /home/troush/Work/ufoJS/env/javascript/tests-node.js:66:2
<stack
ERROR IN:
function Test_parseDate() {
//This are not really in depth tests of the function. Anyone?

    var expected = Date.parse('Fri Oct 14 2011 00:21:40 GMT+0200 (CEST)');
        result = main.parseDate('2011-10-13T22:21:40.000Z');
    doh.assertEqual(expected, result);

    //see if the fallback to standart parsing works, too
    var dateJS = 'Fri Oct 14 2011 00:21:40 GMT+0200 (CEST)',
        expected = Date.parse(dateJS);
        result = main.parseDate(dateJS);
    doh.assertEqual(expected, result);

    // actually this passes but is rather an implementation specific
    // detail. the timestamp is generated with Date.UTC() which can do
    // date arithmetic things i.e. the 13. month is the first month of
    // next year. Is this expected from a dateparsing function???
    // if yes we must test it.
    var expected = 'Sun Feb 05 2012 05:11:40 GMT+0100 (CET)',
        result = (new Date(main.parseDate('2011-13-35T27:71:40.000Z'))).toString();
    doh.assertEqual(expected, result);

    var result = new Date(main.parseDate('This is no date at all.'));
    doh.assertTrue(isNaN(result.getTime()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant