Skip to content

Commit

Permalink
failing test for multi-statement intersperse statements
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Jun 13, 2011
1 parent 37ed055 commit 190240b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,24 @@ exports.binaryFn = function () {

assert.equal(res, 10 * (3*2 - 4*2));
};

exports.intersperse = function () {
var src = '(' + (function () {
f();
g();
}).toString() + ')()';

var times = { f : 0, g : 0, zzz : 0 };

var context = {
f : function () { times.f ++ },
g : function () { times.g ++ },
zzz : function () { times.zzz ++ },
};

burrito.microwave(src, context, function (node) {
if (node.name === 'stat') node.wrap('zzz();%s');
});

assert.deepEqual(times, { f : 1, g : 1, zzz : 2 });
};

0 comments on commit 190240b

Please sign in to comment.