critocrito / sugarcube

Monoidal data processes.
https://sugarcubetools.net
GNU General Public License v3.0
33 stars 5 forks source link

Failing tests #1

Closed infojunkie closed 1 year ago

infojunkie commented 6 years ago

Just getting up and running here. I thought I'd mention the following test failures with the latest code:

  1) maybeDate
       parses string in German format:
     Error: Failed after 1 tests and 0 shrinks. rngState: 83152e9af3b47d086c; Counterexample: "2014-05-17T00:00:00.000Z"; 
      at /media/kratib/data/src/meedan/sugarcube/node_modules/jsverify/lib/jsverify.js:360:15
      at Object.map (node_modules/jsverify/lib/functor.js:35:12)
      at checkThrow (node_modules/jsverify/lib/jsverify.js:354:30)
      at Context.<anonymous> (node_modules/jsverify/lib/jsverify.js:400:14)

  2) maybeDate
       parses string in US format:
     Error: Failed after 1 tests and 0 shrinks. rngState: 8d481cf3d6ea705b29; Counterexample: "2014-12-06T00:00:00.000Z"; 
      at /media/kratib/data/src/meedan/sugarcube/node_modules/jsverify/lib/jsverify.js:360:15
      at Object.map (node_modules/jsverify/lib/functor.js:35:12)
      at checkThrow (node_modules/jsverify/lib/jsverify.js:354:30)
      at Context.<anonymous> (node_modules/jsverify/lib/jsverify.js:400:14)

  3) maybeDate
       parses string in ISO8601 format:
     Error: Failed after 1 tests and 0 shrinks. rngState: 89d64c78afbe295031; Counterexample: "2014-11-28T00:00:00.000Z"; 
      at /media/kratib/data/src/meedan/sugarcube/node_modules/jsverify/lib/jsverify.js:360:15
      at Object.map (node_modules/jsverify/lib/functor.js:35:12)
      at checkThrow (node_modules/jsverify/lib/jsverify.js:354:30)
      at Context.<anonymous> (node_modules/jsverify/lib/jsverify.js:400:14)

  4) maybeDate
       parses string in little endian hyphened format:
     Error: Failed after 1 tests and 0 shrinks. rngState: 82bfdc39e08271a564; Counterexample: "2014-10-02T00:00:00.000Z"; 
      at /media/kratib/data/src/meedan/sugarcube/node_modules/jsverify/lib/jsverify.js:360:15
      at Object.map (node_modules/jsverify/lib/functor.js:35:12)
      at checkThrow (node_modules/jsverify/lib/jsverify.js:354:30)
      at Context.<anonymous> (node_modules/jsverify/lib/jsverify.js:400:14)

Thanks!

critocrito commented 6 years ago

Hey @infojunkie,

Thanks so much for trying Sugarcube and reporting this. Unfortunately I can't reproduce the issue. The tests run fine on my machine. Maybe you would like to try again, possibly from a clean checkout?

git clone git@github.com:critocrito/sugarcube.git
cd sugarcube
yarn install
lerna bootstrap
yarn test
infojunkie commented 6 years ago

Date test failures are usually an indication of timezone issues in the code. When I set the timezone to UTC via timedatectl set-timezone UTC, npm run test does not fail. Returning to my timezone via timedatectl set-timezone America/Vancouver, the 4 tests fail again reliably.