Initial import of 4.x module.

This commit is contained in:
Erik C. Thauvin 2016-07-23 15:37:07 -07:00
parent af67f93887
commit b4d2df93d3
8 changed files with 193 additions and 0 deletions

35
test.js Normal file
View file

@ -0,0 +1,35 @@
var chai = require('chai');
var expect = chai.expect;
var match = require('syntaxhighlighter-match');
var Brush = require('./brush');
var sample = require('fs').readFileSync(`${__dirname}/sample.txt`, 'utf8');
describe('brush-java', function() {
var instance = null;
before(function() {
instance = new Brush();
});
it('has populated code sample', function() {
expect(sample).to.not.match(/^Populate/);
});
describe('instance', function() {
it('has `regexList`', function() {
expect(instance).to.have.property('regexList');
});
});
describe('parsing', function() {
var matches = null;
before(function() {
matches = match.applyRegexList(sample, instance.regexList);
});
it('can parse', function() {
expect(matches).to.have.length.above(0);
});
});
});