Skip to content

Commit

Permalink
Merge pull request #48 from wmde/test-for-calendar-issue
Browse files Browse the repository at this point in the history
Add test for time.Time.equals() with different calendar models.
  • Loading branch information
snaterlicious committed Nov 7, 2014
2 parents 9001e5e + 2a27f44 commit 3296640
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/lib/time/time.Time.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,20 @@ define( [
time.settings.daybeforemonth = dbmStateBefore; // reset state of evil global setting
} );

QUnit.test( 'Equality of Time objects with different calendar model', function( assert ) {
$.each( validTimeDefinitions, function( name, definition ) {
var time1 = new Time( definition ),
time2 = new Time( definition, {
calendarname: definition.calendarname === Time.CALENDAR.GREGORIAN
? Time.CALENDAR.JULIAN
: Time.CALENDAR.GREGORIAN
} );

assert.ok(
!time1.equals( time2 ) && !time2.equals( time1 ),
'Time created from string "' + name + '" but different calendar model is not equal'
);
} );
} );

} );

0 comments on commit 3296640

Please sign in to comment.