Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
STAH committed Feb 3, 2016
1 parent a7350cf commit cb257c3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ require('./test_07_02.js');
require('./test_08.js');
require('./test_09_01.js');
require('./test_09_02.js');
require('./test_12.js');
4 changes: 4 additions & 0 deletions tests/samples/issue10_include.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// #ifndef TEST
// #define var TEST=true
console.log('test');
// #endif
3 changes: 3 additions & 0 deletions tests/samples/issue10_main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// #include "issue10_include.js"
console.log('testing include');
// #include "issue10_include.js"
14 changes: 14 additions & 0 deletions tests/test_12.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* eslint no-console: 0 */

var test = require('tape');

var Preprocessor = require(__dirname + '/../Preprocessor.js');
var fs = require('fs');

test('test_12:issue10', function(t) {
var pp = new Preprocessor(fs.readFileSync(__dirname + '/samples/issue10_main.js'), __dirname + '/samples');
var src = pp.process({}, console.log).replace(/\r/g, '');
t.equal(src, "console.log('test');\nconsole.log('testing include');\n");

t.end();
});

0 comments on commit cb257c3

Please sign in to comment.