origamitower / folktale

[not actively maintained!] A standard library for functional programming in JavaScript
https://folktale.origamitower.com/
MIT License
2.05k stars 102 forks source link

`mapEntries(a, noop, noop) == a` test fails in Node 9+ #197

Closed robotlolita closed 6 years ago

robotlolita commented 6 years ago

The following fails in Node 9+ on Linux (unsure about other OSs)

property('returns what define returns', 'dict nat', (a) => {
      $ASSERT(_.mapEntries(a, ([k, v]) => [k, v], (o, k, v) => ({ ...o, [k]: v })) == a);
      return true
    });

The problem might be in jsverify or the $ASSERT macro.

Stack trace:

``` 1) Core.Object mapEntries(o, f, define) returns what define returns: AssertionError [ERR_ASSERTION]: Failed after 1 tests and 14 shrinks. rngState: 078714a5b2f3ed90c6; Counterexample: {: 0}; Exception: _.mapEntries(a, ([k, v]) => [k, v], (o, k, v) => ({ ...o, [k]: v })) ==> a. The LHS ([object Object]) and the RHS ([object Object]) are not structually equal. + expected - actual at compare (test/source/specs/base/core/object.js:60:259) at metamagical_assert_equals (test/source/specs/base/core/object.js:63:3) at test/source/specs/base/core/object.js:112:7 at Object.bind (node_modules/jsverify/lib/functor.js:48:11) at test (node_modules/jsverify/lib/jsverify.js:199:20) at node_modules/jsverify/lib/jsverify.js:138:13 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at node_modules/lazy-seq/index.js:226:24 at node_modules/jsverify/lib/jsverify.js:140:41 at Object.map (node_modules/jsverify/lib/functor.js:35:12) at node_modules/jsverify/lib/jsverify.js:139:20 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at Object.fold (node_modules/lazy-seq/index.js:440:17) at shrinkResult (node_modules/jsverify/lib/jsverify.js:137:25) at node_modules/jsverify/lib/jsverify.js:220:16 at Object.bind (node_modules/jsverify/lib/functor.js:63:12) at test (node_modules/jsverify/lib/jsverify.js:199:20) at node_modules/jsverify/lib/jsverify.js:138:13 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at node_modules/lazy-seq/index.js:226:24 at node_modules/jsverify/lib/jsverify.js:140:41 at Object.map (node_modules/jsverify/lib/functor.js:35:12) at node_modules/jsverify/lib/jsverify.js:139:20 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at Object.fold (node_modules/lazy-seq/index.js:440:17) at shrinkResult (node_modules/jsverify/lib/jsverify.js:137:25) at node_modules/jsverify/lib/jsverify.js:220:16 at Object.bind (node_modules/jsverify/lib/functor.js:63:12) at test (node_modules/jsverify/lib/jsverify.js:199:20) at node_modules/jsverify/lib/jsverify.js:138:13 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at node_modules/lazy-seq/index.js:226:24 at node_modules/jsverify/lib/jsverify.js:140:41 at Object.map (node_modules/jsverify/lib/functor.js:35:12) at node_modules/jsverify/lib/jsverify.js:139:20 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at Object.fold (node_modules/lazy-seq/index.js:440:17) at shrinkResult (node_modules/jsverify/lib/jsverify.js:137:25) at node_modules/jsverify/lib/jsverify.js:220:16 at Object.bind (node_modules/jsverify/lib/functor.js:63:12) at test (node_modules/jsverify/lib/jsverify.js:199:20) at node_modules/jsverify/lib/jsverify.js:138:13 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at node_modules/lazy-seq/index.js:226:24 at node_modules/jsverify/lib/jsverify.js:140:41 at Object.map (node_modules/jsverify/lib/functor.js:35:12) at node_modules/jsverify/lib/jsverify.js:139:20 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at Object.fold (node_modules/lazy-seq/index.js:440:17) at shrinkResult (node_modules/jsverify/lib/jsverify.js:137:25) at node_modules/jsverify/lib/jsverify.js:220:16 at Object.bind (node_modules/jsverify/lib/functor.js:63:12) at test (node_modules/jsverify/lib/jsverify.js:199:20) at node_modules/jsverify/lib/jsverify.js:138:13 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at node_modules/lazy-seq/index.js:226:24 at node_modules/jsverify/lib/jsverify.js:140:41 at Object.map (node_modules/jsverify/lib/functor.js:35:12) at node_modules/jsverify/lib/jsverify.js:139:20 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at Object.fold (node_modules/lazy-seq/index.js:440:17) at shrinkResult (node_modules/jsverify/lib/jsverify.js:137:25) at node_modules/jsverify/lib/jsverify.js:220:16 at Object.bind (node_modules/jsverify/lib/functor.js:63:12) at test (node_modules/jsverify/lib/jsverify.js:199:20) at node_modules/jsverify/lib/jsverify.js:138:13 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at node_modules/lazy-seq/index.js:226:24 at node_modules/jsverify/lib/jsverify.js:140:41 at Object.map (node_modules/jsverify/lib/functor.js:35:12) at node_modules/jsverify/lib/jsverify.js:139:20 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at Object.fold (node_modules/lazy-seq/index.js:440:17) at shrinkResult (node_modules/jsverify/lib/jsverify.js:137:25) at node_modules/jsverify/lib/jsverify.js:220:16 at Object.bind (node_modules/jsverify/lib/functor.js:63:12) at test (node_modules/jsverify/lib/jsverify.js:199:20) at node_modules/jsverify/lib/jsverify.js:138:13 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at node_modules/lazy-seq/index.js:226:24 at node_modules/jsverify/lib/jsverify.js:140:41 at Object.map (node_modules/jsverify/lib/functor.js:35:12) at node_modules/jsverify/lib/jsverify.js:139:20 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at Object.fold (node_modules/lazy-seq/index.js:440:17) at shrinkResult (node_modules/jsverify/lib/jsverify.js:137:25) at node_modules/jsverify/lib/jsverify.js:220:16 at Object.bind (node_modules/jsverify/lib/functor.js:63:12) at test (node_modules/jsverify/lib/jsverify.js:199:20) at node_modules/jsverify/lib/jsverify.js:138:13 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at node_modules/lazy-seq/index.js:226:24 at node_modules/jsverify/lib/jsverify.js:140:41 at Object.map (node_modules/jsverify/lib/functor.js:35:12) at node_modules/jsverify/lib/jsverify.js:139:20 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at Object.fold (node_modules/lazy-seq/index.js:440:17) at shrinkResult (node_modules/jsverify/lib/jsverify.js:137:25) at node_modules/jsverify/lib/jsverify.js:220:16 at Object.bind (node_modules/jsverify/lib/functor.js:63:12) at test (node_modules/jsverify/lib/jsverify.js:199:20) at node_modules/jsverify/lib/jsverify.js:138:13 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at node_modules/lazy-seq/index.js:226:24 at node_modules/jsverify/lib/jsverify.js:140:41 at Object.map (node_modules/jsverify/lib/functor.js:35:12) at node_modules/jsverify/lib/jsverify.js:139:20 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at Object.fold (node_modules/lazy-seq/index.js:440:17) at shrinkResult (node_modules/jsverify/lib/jsverify.js:137:25) at node_modules/jsverify/lib/jsverify.js:220:16 at Object.bind (node_modules/jsverify/lib/functor.js:63:12) at test (node_modules/jsverify/lib/jsverify.js:199:20) at node_modules/jsverify/lib/jsverify.js:138:13 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at Object.fold (node_modules/lazy-seq/index.js:440:17) at shrinkResult (node_modules/jsverify/lib/jsverify.js:137:25) at node_modules/jsverify/lib/jsverify.js:220:16 at Object.bind (node_modules/jsverify/lib/functor.js:63:12) at test (node_modules/jsverify/lib/jsverify.js:199:20) at node_modules/jsverify/lib/jsverify.js:138:13 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at Object.fold (node_modules/lazy-seq/index.js:440:17) at shrinkResult (node_modules/jsverify/lib/jsverify.js:137:25) at node_modules/jsverify/lib/jsverify.js:220:16 at Object.bind (node_modules/jsverify/lib/functor.js:63:12) at test (node_modules/jsverify/lib/jsverify.js:199:20) at node_modules/jsverify/lib/jsverify.js:138:13 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at Object.fold (node_modules/lazy-seq/index.js:440:17) at shrinkResult (node_modules/jsverify/lib/jsverify.js:137:25) at node_modules/jsverify/lib/jsverify.js:220:16 at Object.bind (node_modules/jsverify/lib/functor.js:63:12) at test (node_modules/jsverify/lib/jsverify.js:199:20) at node_modules/jsverify/lib/jsverify.js:138:13 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at Object.fold (node_modules/lazy-seq/index.js:440:17) at shrinkResult (node_modules/jsverify/lib/jsverify.js:137:25) at node_modules/jsverify/lib/jsverify.js:220:16 at Object.bind (node_modules/jsverify/lib/functor.js:63:12) at test (node_modules/jsverify/lib/jsverify.js:199:20) at node_modules/jsverify/lib/jsverify.js:138:13 at Cons.consFold [as fold] (node_modules/lazy-seq/index.js:225:10) at Object.fold (node_modules/lazy-seq/index.js:440:17) at shrinkResult (node_modules/jsverify/lib/jsverify.js:137:25) at node_modules/jsverify/lib/jsverify.js:220:16 at Object.bind (node_modules/jsverify/lib/functor.js:63:12) at test (node_modules/jsverify/lib/jsverify.js:199:20) at node_modules/jsverify/lib/jsverify.js:227:13 at loop (node_modules/jsverify/lib/jsverify.js:303:26) at check (node_modules/jsverify/lib/jsverify.js:319:34) at checkThrow (node_modules/jsverify/lib/jsverify.js:341:34) at Context. (node_modules/jsverify/lib/jsverify.js:387:14) ```