[Groonga-commit] groonga/gcs [master] bq: throw exception for no phrase close quote

Back to archive index

null+****@clear***** null+****@clear*****
2012年 8月 6日 (月) 14:54:48 JST


Kouhei Sutou	2012-08-06 14:54:48 +0900 (Mon, 06 Aug 2012)

  New Revision: 864cce60efac8b08b30557f4550a35e68be3854e
  https://github.com/groonga/gcs/commit/864cce60efac8b08b30557f4550a35e68be3854e

  Log:
    bq: throw exception for no phrase close quote

  Modified files:
    lib/bq-translator.js
    test/bq-translator.test.js

  Modified: lib/bq-translator.js (+1 -2)
===================================================================
--- lib/bq-translator.js    2012-08-06 14:53:05 +0900 (d04011c)
+++ lib/bq-translator.js    2012-08-06 14:54:48 +0900 (aea25b1)
@@ -305,8 +305,7 @@ BooleanQueryTranslator.prototype = {
       }
     }
 
-    // TODO: report error: missing close quote <"'>
-    return "";
+    this.throwTranslateError("close double quote for phrase is missing");
   },
   translateExpressionValueUnsignedInteger: function(field) {
     var is_range = false;

  Modified: test/bq-translator.test.js (+5 -0)
===================================================================
--- test/bq-translator.test.js    2012-08-06 14:53:05 +0900 (6a2d528)
+++ test/bq-translator.test.js    2012-08-06 14:54:48 +0900 (c8048ca)
@@ -284,8 +284,13 @@ suite('BoolanQueryTranslator', function() {
                       "'keyword1\\",
                       "'keyword1\\||",
                       "escaped character is missing in string value");
+
   testExpressionError("value only: phrase: missing escaped value",
                       "'\"keyword1\\",
                       "'\"keyword1\\||",
                       "escaped character is missing in phrase");
+  testExpressionError("value only: phrase: missing close quote",
+                      "'\"keyword",
+                      "'\"keyword||",
+                      "close double quote for phrase is missing");
 });
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Download 



Groonga-commit メーリングリストの案内
Back to archive index