0

Does it exist? I can't find it and it isn't listed on wikipedia. (which means it doesn't exist :) )

I know node.js has it. Not sure if writing my node app in coffeescript and applying quick check would work.

http://en.wikipedia.org/wiki/Quick_check

Any clues?

The Internet
  • 7,959
  • 10
  • 54
  • 89

1 Answers1

1

I don't know of any QuickCheck library written particularly in or for CoffeeScript, but googling pulls up qc.js. Here's a snippet from demo.js in that repository:

declare("reverse", [arbWholeNumList, arbWholeNumList],
        function(c, x, y) {
            var z = x.concat(y);
            x.reverse();
            y.reverse();
            z.reverse();
            c.assert(z.toString() == y.concat(x).toString());
        });

Now I'm no CoffeeScript expert, but I ran this through http://js2coffee.org. If you can manage to import qc.js, then using it from CoffeeScript would look something like this:

declare "reverse", [ arbWholeNumList, arbWholeNumList ], (c, x, y) ->
  z = x.concat(y)
  x.reverse()
  y.reverse()
  z.reverse()
  c.assert z.toString() is y.concat(x).toString()
Dan Burton
  • 53,238
  • 27
  • 117
  • 198