diff options
-rw-r--r-- | test/fixtures/PAGE.MD | 30 | ||||
-rw-r--r-- | test/page.js | 15 |
2 files changed, 45 insertions, 0 deletions
diff --git a/test/fixtures/PAGE.MD b/test/fixtures/PAGE.MD new file mode 100644 index 0000000..79fc10c --- /dev/null +++ b/test/fixtures/PAGE.MD @@ -0,0 +1,30 @@ +# Python basics + +Python is a nice language, you can add stuff. Bla bla bla. + +Lets jump into an exercise : + +--- + +It's dead simple, `c` must be the sum of `a` and `b` + +```py +a = 1 +b = 2 +``` + +```py +a = 1 +b = 2 +c = a + b +``` + +```py +assert(c, 3) +``` + +--- + +Some more nice content .... + +[Cool stuff](http://gitbook.io) diff --git a/test/page.js b/test/page.js new file mode 100644 index 0000000..9ed91bb --- /dev/null +++ b/test/page.js @@ -0,0 +1,15 @@ +var fs = require('fs'); +var path = require('path'); +var assert = require('assert'); + +var page = require('../lib/page'); + + +var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/PAGE.md'), 'utf8'); +var LEXED = page(CONTENT); + +describe('Page parsing', function() { + it('should detection sections', function() { + assert.equal(LEXED.length, 3); + }); +}); |