From 3e1c5528e1a44da8b787e8207383e09ce8e0ef98 Mon Sep 17 00:00:00 2001 From: nisstyre56 Date: Sun, 16 Mar 2014 01:11:52 -0400 Subject: [PATCH] fixed bug in operator matching function --- test.js | 3 +++ tools.js | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test.js b/test.js index efbfe2c..a360582 100755 --- a/test.js +++ b/test.js @@ -97,6 +97,9 @@ function extendProp(pair) { return x.length + y.length === extended.length; } +/* Tokenizer tests */ + + function toolsTests() { assert.equal(true, tools.empty([])); assert.equal(true, qc.forAll(dictProp, arbArrayofPairs)); diff --git a/tools.js b/tools.js index 8fe5c36..5e65e34 100644 --- a/tools.js +++ b/tools.js @@ -1,5 +1,4 @@ var _ = require("underscore"); -var example = require("./failing.js"); function empty(xs) { return _.size(xs) < 1; @@ -55,7 +54,7 @@ RegExp.escape= function(s) { function operatorMatch(ops) { ops = _.filter(ops, function (op) { - return op.replace(/ /g,'').length > 1; + return op.length > 0; }); var rstring = ops.sort(min).reduce( function(acc, x) {