Shrinks fail on properties taking an arbitrary array and two smap arbitraries #113

Closed
matthewleon opened this Issue May 30, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@matthewleon

A test written in the manner described in the title of this bug will fail to run shrinks properly, attempting to run an array shrink on non-array arguments. That probably sounds confusing, so this is best explained by running mocha on a gist: https://gist.github.com/matthewleon/a205970ce3cefa15f08a

mlg-ell:verifytest mattleon$ mocha


  test with arbitrary array and two smapped arbitrary params
{ '0': 
   [ { [Function] smap: [Function: shrinkProtoIsoMap] },
     { [Function] smap: [Function: shrinkProtoIsoMap] },
     { [Function] smap: [Function: shrinkProtoIsoMap] } ],
  '1': [ [ 4, 2, 17 ], 21, 15 ] }
    1) does not shrink


  0 passing (13ms)
  1 failing

  1) test with arbitrary array and two smapped arbitrary params does not shrink:
     AssertionError: shrinkArrayImpl() expects array, got: 21
      at /Users/mattleon/proj/verifytest/node_modules/jsverify/lib/shrink.js:154:7
      at /Users/mattleon/proj/verifytest/node_modules/jsverify/lib/shrink.js:70:21
      at /Users/mattleon/proj/verifytest/node_modules/jsverify/lib/shrink.js:28:12
      at /Users/mattleon/proj/verifytest/node_modules/jsverify/lib/shrink.js:71:21
      at /Users/mattleon/proj/verifytest/node_modules/jsverify/lib/shrink.js:28:12
      at Object.curriedNInstance [as curried2] (/Users/mattleon/proj/verifytest/node_modules/jsverify/lib/utils.js:110:14)
      at Object.shrinkTuple [as tuple] (/Users/mattleon/proj/verifytest/node_modules/jsverify/lib/shrink.js:148:16)
      at shrinkResult (/Users/mattleon/proj/verifytest/node_modules/jsverify/lib/jsverify.js:122:25)
      at /Users/mattleon/proj/verifytest/node_modules/jsverify/lib/jsverify.js:204:14
      at Object.bind (/Users/mattleon/proj/verifytest/node_modules/jsverify/lib/functor.js:55:12)
      at test (/Users/mattleon/proj/verifytest/node_modules/jsverify/lib/jsverify.js:183:20)
      at /Users/mattleon/proj/verifytest/node_modules/jsverify/lib/jsverify.js:210:13
      at loop (/Users/mattleon/proj/verifytest/node_modules/jsverify/lib/jsverify.js:278:13)
      at check (/Users/mattleon/proj/verifytest/node_modules/jsverify/lib/jsverify.js:293:22)
      at checkThrow (/Users/mattleon/proj/verifytest/node_modules/jsverify/lib/jsverify.js:315:22)
      at Context.<anonymous> (/Users/mattleon/proj/verifytest/node_modules/jsverify/lib/jsverify.js:354:14)
      at callFn (/usr/local/lib/node_modules/mocha/lib/runnable.js:251:21)
      at Test.Runnable.run (/usr/local/lib/node_modules/mocha/lib/runnable.js:244:7)
      at Runner.runTest (/usr/local/lib/node_modules/mocha/lib/runner.js:374:10)
      at /usr/local/lib/node_modules/mocha/lib/runner.js:452:12
      at next (/usr/local/lib/node_modules/mocha/lib/runner.js:299:14)
      at /usr/local/lib/node_modules/mocha/lib/runner.js:309:7
      at next (/usr/local/lib/node_modules/mocha/lib/runner.js:248:23)
      at Immediate._onImmediate (/usr/local/lib/node_modules/mocha/lib/runner.js:276:5)
      at processImmediate [as _immediateCallback] (timers.js:358:17)

phadej added a commit that referenced this issue May 30, 2015

phadej added a commit that referenced this issue May 30, 2015

@phadej

This comment has been minimized.

Show comment
Hide comment
@phadej

phadej May 30, 2015

Member

I succeed to find a much smaller failing case. Shrink for tuple seems to be broken.

Member

phadej commented May 30, 2015

I succeed to find a much smaller failing case. Shrink for tuple seems to be broken.

phadej added a commit that referenced this issue May 31, 2015

@phadej phadej closed this in d7aef71 May 31, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment