Permalink
Browse files

fixing tests

  • Loading branch information...
1 parent 17e628d commit 529114ef949b9050b94f18915ac33860401e51a8 @elmerbulthuis committed Apr 21, 2012
Showing with 9 additions and 9 deletions.
  1. +3 −3 test/js.js
  2. +1 −1 test/simple.js
  3. +2 −2 test/switching.js
  4. +3 −3 test/tag.js
View
@@ -4,7 +4,7 @@ var Tokenizer = require("2kenizer");
function parse(data) {
var tokenizer = new Tokenizer(function(token, buffer) {
- if(!token) return;
+ if(!token.category) return;
//console.log(token.category, token[0]);
@@ -30,13 +30,13 @@ function parse(data) {
var contextStack = [];
function enterContext(context) {
currentContext = context;
- tokenizer.filter(currentContext.filter);
+ tokenizer.categories = currentContext.filter;
contextStack.unshift(currentContext);
}
function exitContext() {
contextStack.shift();
currentContext = contextStack[0];
- tokenizer.filter(currentContext.filter);
+ tokenizer.categories = currentContext.filter;
assert.ok(contextStack.length > 0);
}
View
@@ -3,7 +3,7 @@ var Tokenizer = require('2kenizer');
var tokens = '';
var tokenizer = new Tokenizer(function(token, buffer) {
- if(!token) return;
+ if(!token.category) return;
tokens += token.category;
View
@@ -3,12 +3,12 @@ var Tokenizer = require('2kenizer');
var tokens = '';
var tokenizer = new Tokenizer(function(token, buffer) {
- if(!token) return;
+ if(!token.category) return;
switch(token.category) {
case 'A':
if(token[0] == 'yz') {
- tokenizer.filter(['0']);
+ tokenizer.categories = ['0'];
}
break;
View
@@ -9,7 +9,7 @@ function parse(data) {
var newline = "\n";
var tokenizer = new Tokenizer(function(token, buffer) {
- if(!token) return;
+ if(!token.category) return;
for(var index = buffer.indexOf(newline); ~index && index < token.index; index = buffer.indexOf(newline, index + newline.length)) {
line++;
@@ -30,15 +30,15 @@ function parse(data) {
var contextStack = [];
function enterContext(context) {
currentContext = context;
- tokenizer.filter(currentContext.filter);
+ tokenizer.categories = currentContext.filter;
contextStack.unshift(currentContext);
//console.log(arguments.callee, currentContext.category);
}
function exitContext() {
contextStack.shift();
currentContext = contextStack[0];
- tokenizer.filter(currentContext.filter);
+ tokenizer.categories = currentContext.filter;
assert.ok(contextStack.length > 0);
//console.log(arguments.callee, currentContext.category);

0 comments on commit 529114e

Please sign in to comment.