Skip to content

Commit

Permalink
Test break after label is used to continue.
Browse files Browse the repository at this point in the history
Closes #254.
  • Loading branch information
flatheadmill committed May 25, 2015
1 parent face366 commit 4b1c7f3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion t/redux/loop.t.js
@@ -1,4 +1,4 @@
require('proof')(4, prove)
require('proof')(5, prove)

function prove (assert) {
var cadence = require('../../redux')
Expand Down Expand Up @@ -46,6 +46,15 @@ function prove (assert) {
})(function (error, i) {
assert(i, 1, 'continued')
})

cadence(function (async) {
var loop = async(function (i) {
if (i == 0) return [ loop(), i + 1 ]
else return [ loop, i + 1 ]
})(0)
})(function (error, i) {
assert(i, 2, 'continue then break')
})
}

function item (number, callback) { callback(null, number) }

0 comments on commit 4b1c7f3

Please sign in to comment.