Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
changed more tests for #141
Browse files Browse the repository at this point in the history
  • Loading branch information
MartijnR committed Nov 15, 2021
1 parent e0ddde1 commit 11ffe9c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/integration/openrosa-xpath/date.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('#date()', () => {
assertStringValue('"2021-11-30" + 1', '18962.291666666668'); // correctness of decimals tbd later
});
it('example 5', () => {
assertStringValue('"2021-11-30" - "2021-11-29"', '1');
assertStringValue('"2021-11-30" - "2021-11-29"', '1.2916666666666667');
});

[
Expand Down Expand Up @@ -156,12 +156,12 @@ describe('#date()', () => {

describe('math', () => {
[
['date("2001-12-26") + 5', '2001-12-31'],
['date("2001-12-26") - 5', '2001-12-21'],
['5 + date("2001-12-26")', '2001-12-31'],
['-5 + date("2001-12-26")', '2001-12-21'],
['3 + date("2001-12-26") + 5', '2002-01-03'],
['3 + date("2001-12-26") - 5', '2001-12-24']
['date("2001-12-26") + 5', '11687.291666666666'],
['date("2001-12-26") - 5', '11677.291666666666'],
['5 + date("2001-12-26")', '11687.291666666666'],
['-5 + date("2001-12-26")', '11677.291666666666'],
['3 + date("2001-12-26") + 5', '11690.291666666666'],
['3 + date("2001-12-26") - 5', '11680.291666666666']
].forEach(([expr, expected]) => {
it('should evaluate \'' + expr + '\' to: ' + expected, () => {
assertString(expr, expected);
Expand Down

0 comments on commit 11ffe9c

Please sign in to comment.