Navigation Menu

Skip to content

Commit

Permalink
Add tests for "select --drilldown"
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 21, 2013
1 parent 2a4434c commit 44bbedc
Show file tree
Hide file tree
Showing 4 changed files with 246 additions and 0 deletions.
127 changes: 127 additions & 0 deletions test/command/suite/select/drilldown/multiple.expected
@@ -0,0 +1,127 @@
table_create Tags TABLE_PAT_KEY ShortText
[[0,0.0,0.0],true]
table_create Memos TABLE_HASH_KEY ShortText
[[0,0.0,0.0],true]
column_create Memos tag COLUMN_SCALAR Tags
[[0,0.0,0.0],true]
column_create Memos date COLUMN_SCALAR ShortText
[[0,0.0,0.0],true]
load --table Memos
[
{"_key": "groonga is fast!", "tag": "groonga", "date": "2013-06-21"},
{"_key": "mroonga is fast!", "tag": "mroonga", "date": "2013-06-21"},
{"_key": "groonga sticker!", "tag": "groonga", "date": "2013-06-22"},
{"_key": "rroonga is fast!", "tag": "rroonga", "date": "2013-06-23"}
]
[[0,0.0,0.0],4]
select Memos --drilldown tag,date
[
[
0,
0.0,
0.0
],
[
[
[
4
],
[
[
"_id",
"UInt32"
],
[
"_key",
"ShortText"
],
[
"date",
"ShortText"
],
[
"tag",
"Tags"
]
],
[
1,
"groonga is fast!",
"2013-06-21",
"groonga"
],
[
2,
"mroonga is fast!",
"2013-06-21",
"mroonga"
],
[
3,
"groonga sticker!",
"2013-06-22",
"groonga"
],
[
4,
"rroonga is fast!",
"2013-06-23",
"rroonga"
]
],
[
[
3
],
[
[
"_key",
"ShortText"
],
[
"_nsubrecs",
"Int32"
]
],
[
"groonga",
2
],
[
"mroonga",
1
],
[
"rroonga",
1
]
],
[
[
3
],
[
[
"_key",
"ShortText"
],
[
"_nsubrecs",
"Int32"
]
],
[
"2013-06-21",
2
],
[
"2013-06-22",
1
],
[
"2013-06-23",
1
]
]
]
]
15 changes: 15 additions & 0 deletions test/command/suite/select/drilldown/multiple.test
@@ -0,0 +1,15 @@
table_create Tags TABLE_PAT_KEY ShortText

table_create Memos TABLE_HASH_KEY ShortText
column_create Memos tag COLUMN_SCALAR Tags
column_create Memos date COLUMN_SCALAR ShortText

load --table Memos
[
{"_key": "groonga is fast!", "tag": "groonga", "date": "2013-06-21"},
{"_key": "mroonga is fast!", "tag": "mroonga", "date": "2013-06-21"},
{"_key": "groonga sticker!", "tag": "groonga", "date": "2013-06-22"},
{"_key": "rroonga is fast!", "tag": "rroonga", "date": "2013-06-23"}
]

select Memos --drilldown tag,date
90 changes: 90 additions & 0 deletions test/command/suite/select/drilldown/single.expected
@@ -0,0 +1,90 @@
table_create Tags TABLE_PAT_KEY ShortText
[[0,0.0,0.0],true]
table_create Memos TABLE_HASH_KEY ShortText
[[0,0.0,0.0],true]
column_create Memos tag COLUMN_SCALAR Tags
[[0,0.0,0.0],true]
load --table Memos
[
{"_key": "groonga is fast!", "tag": "groonga"},
{"_key": "mroonga is fast!", "tag": "mroonga"},
{"_key": "groonga sticker!", "tag": "groonga"},
{"_key": "rroonga is fast!", "tag": "rroonga"}
]
[[0,0.0,0.0],4]
select Memos --drilldown tag
[
[
0,
0.0,
0.0
],
[
[
[
4
],
[
[
"_id",
"UInt32"
],
[
"_key",
"ShortText"
],
[
"tag",
"Tags"
]
],
[
1,
"groonga is fast!",
"groonga"
],
[
2,
"mroonga is fast!",
"mroonga"
],
[
3,
"groonga sticker!",
"groonga"
],
[
4,
"rroonga is fast!",
"rroonga"
]
],
[
[
3
],
[
[
"_key",
"ShortText"
],
[
"_nsubrecs",
"Int32"
]
],
[
"groonga",
2
],
[
"mroonga",
1
],
[
"rroonga",
1
]
]
]
]
14 changes: 14 additions & 0 deletions test/command/suite/select/drilldown/single.test
@@ -0,0 +1,14 @@
table_create Tags TABLE_PAT_KEY ShortText

table_create Memos TABLE_HASH_KEY ShortText
column_create Memos tag COLUMN_SCALAR Tags

load --table Memos
[
{"_key": "groonga is fast!", "tag": "groonga"},
{"_key": "mroonga is fast!", "tag": "mroonga"},
{"_key": "groonga sticker!", "tag": "groonga"},
{"_key": "rroonga is fast!", "tag": "rroonga"}
]

select Memos --drilldown tag

0 comments on commit 44bbedc

Please sign in to comment.