Opened 12 years ago

Closed 12 years ago

#5053 closed defect (fixed)

test_date_add_diff_weekday failure

Reported by: Adam Peller Owned by: Adam Peller
Priority: high Milestone: 1.0.1
Component: Date Version: 0.9
Keywords: Cc: mde@…, Bryan Forbes
Blocked By: Blocking:

Description

Bryan introduced a unit test that shows how this method fails.

    _AssertFailure: file:///users/peller/workspace/1.0-view/dojo/_base/_loader/bootstrap.js:316 doh._AssertFailure: assertEqual() failed: expected |2| but got |1|
 doh._AssertFailure
     ERROR IN:
  (function test_date_add_diff_weekday(t) {var interv = "";var dtA = null;var dtB = null;interv = "weekday";dtA = new Date(2000, 0, 1);dtB = dojo.date.add(dtA, interv, 1);t.is(dojo.date.difference(dtA, dtB, interv), 1);dtA = new Date(2000, 0, 2);dtB = dojo.date.add(dtA, interv, 1);t.is(dojo.date.difference(dtA, dtB, interv), 1);dtA = new Date(2000, 0, 2);dtB = dojo.date.add(dtA, interv, 5);t.is(dojo.date.difference(dtA, dtB, interv), 5);dtA = new Date(2000, 0, 2);dtB = dojo.date.add(dtA, interv, 6);t.is(dojo.date.difference(dtA, dtB, interv), 6);dtA = new Date(2000, 0, 3);dtB = dojo.date.add(dtA, interv, 10);t.is(dojo.date.difference(dtA, dtB, interv), 10);dtA = new Date(2000, 0, 8);dtB = dojo.date.add(dtA, interv, -5);t.is(dojo.date.difference(dtA, dtB, interv), -5);dtA = new Date(2000, 0, 9);dtB = dojo.date.add(dtA, interv, -3);t.is(dojo.date.difference(dtA, dtB, interv), -3);dtA = new Date(2000, 0, 23);dtB = dojo.date.add(dtA, interv, -11);t.is(dojo.date.difference(dtA, dtB, interv), -11);})
 FAILED test: test_date_add_diff_weekday

Change History (3)

comment:1 Changed 12 years ago by Adam Peller

Cc: Bryan Forbes added

comment:2 Changed 12 years ago by Adam Peller

(In [11484]) Fixes really old regression in add weekday routine. Thanks, Bryan for catching this. Refs #5053

comment:3 Changed 12 years ago by Adam Peller

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.