Skip to content

Commit

Permalink
add example test.
Browse files Browse the repository at this point in the history
  • Loading branch information
zswang committed Nov 2, 2015
1 parent 7a9c2b9 commit 4efd40e
Show file tree
Hide file tree
Showing 20 changed files with 1,618 additions and 378 deletions.
45 changes: 45 additions & 0 deletions example.jdists.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
var assert = require('should');
var jpacks = require('../.');
var util = require('util');

var zlib = require('../schemas-extend/zlib');
zlib(jpacks);

var printValue;
function print(value) {
printValue = value;
}

/*<remove>*/
// <!--jdists encoding="glob" pattern="./src/**/*.js" export="#files" /-->
/*</remove>*/

/*<jdists encoding="jhtmls,regex" pattern="/~/g" replacement="--" data="#files" export="#example">*/
forEach(function (item) {
!#{'describe("' + item + '", function () {'}
<!~jdists import="#{item}?example*" /~>
!#{'});'}
});
<!~jdists import="schemas-extend/zlib.js?example*" /~>
/*</jdists>*/

<!--jdists export="#pattern">/^\s*\*\s*@example\s*(.*)$/mg</jdists-->
<!--jdists export="#replacement"> it("$1", function () {</jdists-->
<!--jdists encoding="regex" import="#example" pattern="#pattern" replacement="#replacement" export="#example" /-->

<!--jdists export="#pattern">/^\s*```js\s*$/mg</jdists-->
<!--jdists export="#replacement"></jdists-->
<!--jdists encoding="regex" import="#example" pattern="#pattern" replacement="#replacement" export="#example" /-->

<!--jdists export="#pattern">/^\s*```\s*$/mg</jdists-->
<!--jdists export="#replacement"> });</jdists-->
<!--jdists encoding="regex" import="#example" pattern="#pattern" replacement="#replacement" export="#example" /-->

<!--jdists export="#pattern">/console\.log/g</jdists-->
<!--jdists export="#replacement">print</jdists-->
<!--jdists encoding="regex" import="#example" pattern="#pattern" replacement="#replacement" export="#example" /-->

<!--jdists export="#pattern">/\/\/ ->\s*(.*)/gm</jdists-->
<!--jdists export="#replacement">assert.equal(printValue, '$1')</jdists-->
<!--jdists encoding="regex" import="#example" pattern="#pattern" replacement="#replacement" export="#example" /-->
/*<jdists import="#example"/>*/
Loading

0 comments on commit 4efd40e

Please sign in to comment.