Skip to content

Commit

Permalink
test: migrate Cutter test for nonexistent key equal to grntest
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 8, 2015
1 parent bcd701a commit fae22fb
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 21 deletions.
@@ -0,0 +1,48 @@
table_create Bookmarks TABLE_HASH_KEY ShortText
[[0,0.0,0.0],true]
column_create Bookmarks title COLUMN_SCALAR ShortText
[[0,0.0,0.0],true]
table_create Users TABLE_HASH_KEY ShortText
[[0,0.0,0.0],true]
column_create Users bookmark COLUMN_SCALAR Bookmarks
[[0,0.0,0.0],true]
load --table Bookmarks
[
{"_key": "http://groonga.org/", "title": "Groonga"}
]
[[0,0.0,0.0],1]
load --table Users
[
{"_key": "alice", "bookmark": "http://groonga.org/"},
{"_key": "bob"}
]
[[0,0.0,0.0],2]
select Users --filter 'bookmark == "http://nonexistent.example.com/"'
[
[
0,
0.0,
0.0
],
[
[
[
0
],
[
[
"_id",
"UInt32"
],
[
"_key",
"ShortText"
],
[
"bookmark",
"Bookmarks"
]
]
]
]
]
@@ -0,0 +1,18 @@
table_create Bookmarks TABLE_HASH_KEY ShortText
column_create Bookmarks title COLUMN_SCALAR ShortText

table_create Users TABLE_HASH_KEY ShortText
column_create Users bookmark COLUMN_SCALAR Bookmarks

load --table Bookmarks
[
{"_key": "http://groonga.org/", "title": "Groonga"}
]

load --table Users
[
{"_key": "alice", "bookmark": "http://groonga.org/"},
{"_key": "bob"}
]

select Users --filter 'bookmark == "http://nonexistent.example.com/"'
21 changes: 0 additions & 21 deletions test/unit/core/test-table-select.c
Expand Up @@ -35,7 +35,6 @@ static grn_obj text_buf, int_buf, ptr_buf;
void test_equal(void);
void test_equal_indexed(void);
void test_equal_by_existent_reference_key(void);
void test_equal_by_nonexistent_reference_key(void);
void test_select(void);
void test_search(void);
void test_select_search(void);
Expand Down Expand Up @@ -288,26 +287,6 @@ test_equal_by_existent_reference_key(void)
"body");
}

void
test_equal_by_nonexistent_reference_key(void)
{
grn_obj *v;

prepare_data();

GRN_EXPR_CREATE_FOR_QUERY(&context, docs, cond, v);
cut_assert_not_null(cond);
cut_assert_not_null(v);
PARSE(cond, "author == \"nonexistent\"", GRN_EXPR_SYNTAX_SCRIPT);
res = grn_table_select(&context, docs, cond, NULL, GRN_OP_OR);
cut_assert_not_null(res);

grn_test_assert_select(&context,
NULL,
res,
"body");
}

void
test_select(void)
{
Expand Down

0 comments on commit fae22fb

Please sign in to comment.