Navigation Menu

Skip to content

Commit

Permalink
bq: throw exception for unterminated string value
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Aug 6, 2012
1 parent a6fe730 commit 7d8d01e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lib/bq-translator.js
Expand Up @@ -263,8 +263,7 @@ BooleanQueryTranslator.prototype = {
}
}

// TODO: report error: missing close quote <'>
return "";
this.throwTranslateError("close single quote for string value is missing");
},
translateExpressionValueStringKeyword: function(field, value) {
var operator = "@";
Expand Down
5 changes: 5 additions & 0 deletions test/bq-translator.test.js
Expand Up @@ -266,4 +266,9 @@ suite('BoolanQueryTranslator', function() {
"f1:value",
"f1:|v|alue",
"invalid value: field:<f1>");

testExpressionError("field value: string: missing close quote",
"f1:'k1",
"f1:'k1||",
"close single quote for string value is missing");
});

0 comments on commit 7d8d01e

Please sign in to comment.