[Groonga-commit] groonga/gcs [master] bq: throw exception for unterminated string value

Back to archive index

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


Kouhei Sutou	2012-08-06 14:16:42 +0900 (Mon, 06 Aug 2012)

  New Revision: 7d8d01ecd8dc0797b70acefb95ead1bdcbebd9cc
  https://github.com/groonga/gcs/commit/7d8d01ecd8dc0797b70acefb95ead1bdcbebd9cc

  Log:
    bq: throw exception for unterminated string value

  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:12:10 +0900 (59a6b7c)
+++ lib/bq-translator.js    2012-08-06 14:16:42 +0900 (f1db762)
@@ -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 = "@";

  Modified: test/bq-translator.test.js (+5 -0)
===================================================================
--- test/bq-translator.test.js    2012-08-06 14:12:10 +0900 (fdf17e1)
+++ test/bq-translator.test.js    2012-08-06 14:16:42 +0900 (05cfa26)
@@ -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");
 });
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
下載 



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