Your SlideShare is downloading. ×
Suite.js and generators.js rock \m/
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Suite.js and generators.js rock \m/

1,373
views

Published on

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

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,373
On Slideshare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. s and gene rators.jssuite.jrock m/ nJuho Vepsäläine
  • 2. suite.js#!/usr/bin/env nodevar suite = require(suite.js);var f = require(./funkit); suite(f.isDefined, [ foo, true, undefined, false]);
  • 3. mo ar suite.jssuite(f.partial(f.all, f.id), [ [foo], false, [[a, b, c]], true, [[true, false, true]], false]);
  • 4. ebraw/suite.jshttps://github.com/b
  • 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. /generators.jshttps://gith ub.com/bebraw