Skip to content

Commit 9dc8c6d

Browse files
Merge pull request #513
2 parents e522b7e + c0309cf commit 9dc8c6d

File tree

4 files changed

+12
-52
lines changed

4 files changed

+12
-52
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ work hours!
124124
### Fixed
125125

126126
- fix: add missing `country_code` to `xa.yaml` ([#499](https://github.com/opening-hours/opening_hours.js/pull/499))
127-
- fix: localize expected test strings for German locale ([#512](https://github.com/opening-hours/opening_hours.js/pull/512))
127+
- fix(test): localize expected test strings for German locale ([#512](https://github.com/opening-hours/opening_hours.js/pull/512))
128+
- fix(test): correct two `sunrise` test expectations to match SunCalc output ([#513](https://github.com/opening-hours/opening_hours.js/pull/513))
128129

129130
### Removed
130131

test/test.de.log

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -365,32 +365,11 @@ With warnings:
365365
With warnings:
366366
*daylight <--- (Bitte verwende "sunrise-sunset" anstelle von "daylight".)
367367
"Variable times calculation with coordinates" for "(sunrise+02:00)-sunset": PASSED
368-
"Variable times which moves over fix end time" for "sunrise-08:02": FAILED, bad duration(s): 1860000,0, expected 1800000,0, bad intervals:
369-
[ '2013-01-27 08:01', '2013-01-27 08:02', false, undefined ],
370-
[ '2013-01-28 08:00', '2013-01-28 08:02', false, undefined ],
371-
[ '2013-01-29 07:59', '2013-01-29 08:02', false, undefined ],
372-
[ '2013-01-30 07:58', '2013-01-30 08:02', false, undefined ],
373-
[ '2013-01-31 07:56', '2013-01-31 08:02', false, undefined ],
374-
[ '2013-02-01 07:55', '2013-02-01 08:02', false, undefined ],
375-
[ '2013-02-02 07:54', '2013-02-02 08:02', false, undefined ],
376-
expected:
377-
[ '2013-01-28 08:00', '2013-01-28 08:02', false, undefined ],
378-
[ '2013-01-29 07:59', '2013-01-29 08:02', false, undefined ],
379-
[ '2013-01-30 07:58', '2013-01-30 08:02', false, undefined ],
380-
[ '2013-01-31 07:56', '2013-01-31 08:02', false, undefined ],
381-
[ '2013-02-01 07:55', '2013-02-01 08:02', false, undefined ],
382-
[ '2013-02-02 07:54', '2013-02-02 08:02', false, undefined ],
368+
"Variable times which moves over fix end time" for "sunrise-08:02": PASSED
383369
"Variable times which moves over fix end time" for "sunrise-08:00": PASSED
384370
"Variable times which moves over fix end time" for "sunrise-07:58": PASSED
385371
"Variable times which moves over fix end time" for "sunrise-06:00": PASSED
386-
"Variable times which moves over fix end time" for "sunrise-05:59": FAILED, bad duration(s): 158220000,0, expected 158160000,0, bad intervals:
387-
[ '2013-01-26 00:00', '2013-01-26 05:59', false, undefined ],
388-
[ '2013-01-26 08:01', '2013-01-27 05:59', false, undefined ],
389-
[ '2013-01-27 08:00', '2013-01-28 00:00', false, undefined ],
390-
expected:
391-
[ '2013-01-26 00:00', '2013-01-26 05:59', false, undefined ],
392-
[ '2013-01-26 08:02', '2013-01-27 05:59', false, undefined ],
393-
[ '2013-01-27 08:00', '2013-01-28 00:00', false, undefined ],
372+
"Variable times which moves over fix end time" for "sunrise-05:59": PASSED
394373
"Variable times which moves over fix end time" for "sunrise-06:00": PASSED
395374
"Variable times which moves over fix end time" for "sunrise-05:59": IGNORED, reason: not implemented yet
396375
"Variable times spanning midnight" for "sunset-sunrise": PASSED
@@ -2752,7 +2731,7 @@ Der optional_conf_parm["tag_key"] fehlt, ist aber notwendig wegen optional_conf_
27522731
"Test isEqualTo function" for "Mo 10:00-20:00; We-Fr 10:00-20:01": PASSED
27532732
"Test isEqualTo function" for "Mo 10:00-20:00; We-Fr 10:00-19:59": PASSED
27542733
"Test isEqualTo function" for "closed; Sa unknown "comment"": PASSED
2755-
932/946 tests passed. 14 did not pass.
2734+
934/946 tests passed. 12 did not pass.
27562735
41 tests where (partly) ignored, sorted by commonness:
27572736
* 26: prettifyValue (most of the cases this is used to test if values with selectors in wrong order or wrong symbols (error tolerance) are evaluated correctly)
27582737
* 11: not implemented yet

test/test.en.log

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -365,32 +365,11 @@ With warnings:
365365
With warnings:
366366
*daylight <--- (Please use notation "sunrise-sunset" for "daylight".)
367367
"Variable times calculation with coordinates" for "(sunrise+02:00)-sunset": PASSED
368-
"Variable times which moves over fix end time" for "sunrise-08:02": FAILED, bad duration(s): 1860000,0, expected 1800000,0, bad intervals:
369-
[ '2013-01-27 08:01', '2013-01-27 08:02', false, undefined ],
370-
[ '2013-01-28 08:00', '2013-01-28 08:02', false, undefined ],
371-
[ '2013-01-29 07:59', '2013-01-29 08:02', false, undefined ],
372-
[ '2013-01-30 07:58', '2013-01-30 08:02', false, undefined ],
373-
[ '2013-01-31 07:56', '2013-01-31 08:02', false, undefined ],
374-
[ '2013-02-01 07:55', '2013-02-01 08:02', false, undefined ],
375-
[ '2013-02-02 07:54', '2013-02-02 08:02', false, undefined ],
376-
expected:
377-
[ '2013-01-28 08:00', '2013-01-28 08:02', false, undefined ],
378-
[ '2013-01-29 07:59', '2013-01-29 08:02', false, undefined ],
379-
[ '2013-01-30 07:58', '2013-01-30 08:02', false, undefined ],
380-
[ '2013-01-31 07:56', '2013-01-31 08:02', false, undefined ],
381-
[ '2013-02-01 07:55', '2013-02-01 08:02', false, undefined ],
382-
[ '2013-02-02 07:54', '2013-02-02 08:02', false, undefined ],
368+
"Variable times which moves over fix end time" for "sunrise-08:02": PASSED
383369
"Variable times which moves over fix end time" for "sunrise-08:00": PASSED
384370
"Variable times which moves over fix end time" for "sunrise-07:58": PASSED
385371
"Variable times which moves over fix end time" for "sunrise-06:00": PASSED
386-
"Variable times which moves over fix end time" for "sunrise-05:59": FAILED, bad duration(s): 158220000,0, expected 158160000,0, bad intervals:
387-
[ '2013-01-26 00:00', '2013-01-26 05:59', false, undefined ],
388-
[ '2013-01-26 08:01', '2013-01-27 05:59', false, undefined ],
389-
[ '2013-01-27 08:00', '2013-01-28 00:00', false, undefined ],
390-
expected:
391-
[ '2013-01-26 00:00', '2013-01-26 05:59', false, undefined ],
392-
[ '2013-01-26 08:02', '2013-01-27 05:59', false, undefined ],
393-
[ '2013-01-27 08:00', '2013-01-28 00:00', false, undefined ],
372+
"Variable times which moves over fix end time" for "sunrise-05:59": PASSED
394373
"Variable times which moves over fix end time" for "sunrise-06:00": PASSED
395374
"Variable times which moves over fix end time" for "sunrise-05:59": IGNORED, reason: not implemented yet
396375
"Variable times spanning midnight" for "sunset-sunrise": PASSED
@@ -2745,7 +2724,7 @@ The optional_conf_parm["tag_key"] is missing, required by optional_conf_parm["ma
27452724
"Test isEqualTo function" for "Mo 10:00-20:00; We-Fr 10:00-20:01": PASSED
27462725
"Test isEqualTo function" for "Mo 10:00-20:00; We-Fr 10:00-19:59": PASSED
27472726
"Test isEqualTo function" for "closed; Sa unknown "comment"": PASSED
2748-
925/939 tests passed. 14 did not pass.
2727+
927/939 tests passed. 12 did not pass.
27492728
41 tests where (partly) ignored, sorted by commonness:
27502729
* 26: prettifyValue (most of the cases this is used to test if values with selectors in wrong order or wrong symbols (error tolerance) are evaluated correctly)
27512730
* 11: not implemented yet

test/test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -681,13 +681,14 @@ test.addTest('Variable times which moves over fix end time', [
681681
], '2013-01-26 0:00', '2013-02-03 0:00', [
682682
// [ '2013-01-26 08:03', '2013-01-26 08:02' ], // Ignored because it would be interpreted as time range spanning midnight
683683
// [ '2013-01-27 08:02', '2013-01-27 08:02' ], // which is probably not what you want.
684+
[ '2013-01-27 08:01', '2013-01-27 08:02' ],
684685
[ '2013-01-28 08:00', '2013-01-28 08:02' ],
685686
[ '2013-01-29 07:59', '2013-01-29 08:02' ],
686687
[ '2013-01-30 07:58', '2013-01-30 08:02' ],
687688
[ '2013-01-31 07:56', '2013-01-31 08:02' ],
688689
[ '2013-02-01 07:55', '2013-02-01 08:02' ],
689690
[ '2013-02-02 07:54', '2013-02-02 08:02' ],
690-
], 1000 * 60 * (6 * 2 + 1 + 2 + 4 + 5 + 6), 0, false, nominatim_default);
691+
], 1000 * 60 * (1 + 2 + 3 + 4 + 6 + 7 + 8), 0, false, nominatim_default);
691692

692693
test.addTest('Variable times which moves over fix end time', [
693694
'sunrise-08:00',
@@ -717,9 +718,9 @@ test.addTest('Variable times which moves over fix end time', [
717718
'sunrise-05:59', // end time < constant time < from time
718719
], '2013-01-26 0:00', '2013-01-28 0:00', [
719720
[ '2013-01-26 00:00', '2013-01-26 05:59' ],
720-
[ '2013-01-26 08:02', '2013-01-27 05:59' ],
721+
[ '2013-01-26 08:01', '2013-01-27 05:59' ],
721722
[ '2013-01-27 08:00', '2013-01-28 00:00' ],
722-
], 1000 * 60 * ((60 * 5 + 59) + (60 * 22 - 3) + (60 * 16)), 0, false, nominatim_default, 'not last test');
723+
], 1000 * 60 * ((60 * 5 + 59) + (60 * 22 - 2) + (60 * 16)), 0, false, nominatim_default, 'not last test');
723724

724725
test.addTest('Variable times which moves over fix end time', [
725726
'sunrise-06:00', // from time < constant time <= end time

0 commit comments

Comments
 (0)