s and gene rators.jssuite.jrock m/               nJuho Vepsäläine
suite.js#!/usr/bin/env nodevar suite = require(suite.js);var f = require(./funkit); suite(f.isDefined, [    foo, true,    ...
mo ar suite.jssuite(f.partial(f.all, f.id), [    [foo], false,    [[a, b, c]], true,    [[true, false, true]], false]);
ebraw/suite.jshttps://github.com/b
generators.js...var g = require(generators.js); suite(f.choose, suite.generate(5000,    [g.list(10, g.number(100))], funct...
/generators.jshttps://gith ub.com/bebraw
Upcoming SlideShare
Loading in …5
×

Suite.js and generators.js rock \m/

1,875 views

Published on

Quicky 5 min presentation that escalated into 30 mins after some questions. The slides are somewhat terse.

A couple of quick points that might help:
* f.partial (partial application) "locks" a parameter passed to a function. Those not locked remain free. Suppose following: f(a, b). g = partial(f, 'foo'). g('bar) == f('foo', 'bar')
* The bit at generators (see QuickCheck) makes probably a bit more sense if you read it this way "for a in a number list, make sure that choose(a) is between number bounds (min/max)". Essentially all it does is to exercise the function using a bunch of randomly generated asserts such as this.

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,875
On SlideShare
0
From Embeds
0
Number of Embeds
859
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Suite.js and generators.js rock \m/

  1. 1. s and gene rators.jssuite.jrock m/ nJuho Vepsäläine
  2. 2. suite.js#!/usr/bin/env nodevar suite = require(suite.js);var f = require(./funkit); suite(f.isDefined, [ foo, true, undefined, false]);
  3. 3. mo ar suite.jssuite(f.partial(f.all, f.id), [ [foo], false, [[a, b, c]], true, [[true, false, true]], false]);
  4. 4. ebraw/suite.jshttps://github.com/b
  5. 5. generators.js...var g = require(generators.js); suite(f.choose, suite.generate(5000, [g.list(10, g.number(100))], function(op, a) { var ret = op(a); return f.between(-100, 100, ret) || ret; }));
  6. 6. /generators.jshttps://gith ub.com/bebraw

×