[Groonga-commit] groonga/groonga at 127f605 [master] test: migrate to grntest

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Dec 30 12:28:03 JST 2014


Kouhei Sutou	2014-12-30 12:28:03 +0900 (Tue, 30 Dec 2014)

  New Revision: 127f6056f61a2270093a55c8c018de73aaa5b426
  https://github.com/groonga/groonga/commit/127f6056f61a2270093a55c8c018de73aaa5b426

  Message:
    test: migrate to grntest

  Added files:
    test/command/suite/select/filter/invalid/match/argument/column.expected
    test/command/suite/select/filter/invalid/match/argument/column.test
  Modified files:
    test/unit/core/test-command-select-filter-invalid.c

  Added: test/command/suite/select/filter/invalid/match/argument/column.expected (+39 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/invalid/match/argument/column.expected    2014-12-30 12:28:03 +0900 (8d6a419)
@@ -0,0 +1,39 @@
+table_create Sites TABLE_HASH_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Sites uri COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Terms TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Terms sites_key COLUMN_INDEX|WITH_SECTION Sites _key
+[[0,0.0,0.0],true]
+load --table Sites
+[
+["_key", "uri"],
+["Groonga", "http://groonga.org/"],
+["Mroonga", "http://mroonga.org/"]
+]
+[[0,0.0,0.0],2]
+select Sites --filter "_key @ uri"
+[
+  [
+    [
+      -22,
+      0.0,
+      0.0
+    ],
+    "invalid expression: can't use column as a value: <Sites.uri>: <#<expr\n  vars:{\n    $1:#<record:hash:Sites id:(no value)>\n  },\n "
+  ],
+  [
+
+  ]
+]
+#|e| RuntimeError: invalid expression: can't use column as a value: <Sites.uri>: <#<expr
+  vars:{
+    $1:#<record:hash:Sites id:(no value)>
+  },
+  codes:{
+    0:<get_value(), modify:2, value:_key>,
+    1:<get_value(), modify:0, value:#<column:var_size Sites.uri range:ShortText type:scalar compress:none>>,
+    2:<match(), modify:0, value:(NULL)>
+  }
+>>

  Added: test/command/suite/select/filter/invalid/match/argument/column.test (+16 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/invalid/match/argument/column.test    2014-12-30 12:28:03 +0900 (31f6bbb)
@@ -0,0 +1,16 @@
+table_create Sites TABLE_HASH_KEY ShortText
+column_create Sites uri COLUMN_SCALAR ShortText
+
+table_create Terms TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Terms sites_key COLUMN_INDEX|WITH_SECTION Sites _key
+
+load --table Sites
+[
+["_key", "uri"],
+["Groonga", "http://groonga.org/"],
+["Mroonga", "http://mroonga.org/"]
+]"
+
+select Sites --filter "_key @ uri"

  Modified: test/unit/core/test-command-select-filter-invalid.c (+0 -16)
===================================================================
--- test/unit/core/test-command-select-filter-invalid.c    2014-12-30 12:20:34 +0900 (688f8c0)
+++ test/unit/core/test-command-select-filter-invalid.c    2014-12-30 12:28:03 +0900 (054f6a6)
@@ -24,7 +24,6 @@
 #include "../lib/grn-assertions.h"
 
 void test_no_operator_and_parentheses_column(void);
-void test_match_against_not_string(void);
 
 static gchar *tmp_directory;
 
@@ -102,18 +101,3 @@ test_no_operator_and_parentheses_column(void)
     "invalid function: <\"groonga\">",
     "select Sites --filter \"_key != \\\"groonga\\\" ()\"");
 }
-
-void
-test_match_against_not_string(void)
-{
-  grn_test_assert_send_command_error(
-    context,
-    GRN_INVALID_ARGUMENT,
-    "invalid expression: can't use column as a value: "
-    "<Sites.uri>: "
-    "<#<expr\n"
-    "  vars:{\n"
-    "    $1:#<record:hash:Sites id:0(nonexistent)>\n"
-    "  ",
-    "select Sites --filter \"_key @ uri");
-}
-------------- next part --------------
HTML����������������������������...
Descargar 



More information about the Groonga-commit mailing list
Back to archive index