Navigation Menu

Skip to content

Commit

Permalink
Revert "test: remove tests for sortby because it is deprecated"
Browse files Browse the repository at this point in the history
These tests are kept for backward compatibility tests.

This reverts commit cb757ac.
  • Loading branch information
s-yata committed Apr 13, 2017
1 parent cb757ac commit eb8f465
Show file tree
Hide file tree
Showing 66 changed files with 5,785 additions and 0 deletions.
@@ -0,0 +1,121 @@
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 Time
[[0,0.0,0.0],true]
load --table Memos
[
{"_key": "Rroonga is fast!", "tag": "Rroonga", "date": "2014-11-17 00:00:00"},
{"_key": "Mroonga is fast!", "tag": "Mroonga", "date": "2014-11-16 00:00:00"},
{"_key": "Groonga is fast!", "tag": "Groonga", "date": "2014-11-16 00:00:00"},
{"_key": "Groonga sticker!", "tag": "Groonga", "date": "2014-11-16 00:00:00"},
{"_key": "Groonga is good!", "tag": "Groonga", "date": "2014-11-17 00:00:00"}
]
[[0,0.0,0.0],5]
select Memos --filter true --drilldown[tag].keys tag,date --drilldown[tag].output_columns _key[0],_key[1],_nsubrecs --drilldown[tag].sortby _value.tag._key,_value.date
[
[
0,
0.0,
0.0
],
[
[
[
5
],
[
[
"_id",
"UInt32"
],
[
"_key",
"ShortText"
],
[
"date",
"Time"
],
[
"tag",
"Tags"
]
],
[
1,
"Rroonga is fast!",
1416150000.0,
"Rroonga"
],
[
2,
"Mroonga is fast!",
1416063600.0,
"Mroonga"
],
[
3,
"Groonga is fast!",
1416063600.0,
"Groonga"
],
[
4,
"Groonga sticker!",
1416063600.0,
"Groonga"
],
[
5,
"Groonga is good!",
1416150000.0,
"Groonga"
]
],
{
"tag": [
[
4
],
[
[
"_key[0]",
null
],
[
"_key[1]",
null
],
[
"_nsubrecs",
"Int32"
]
],
[
"Groonga",
1416063600.0,
2
],
[
"Groonga",
1416150000.0,
1
],
[
"Mroonga",
1416063600.0,
1
],
[
"Rroonga",
1416150000.0,
1
]
]
}
]
]
@@ -0,0 +1,20 @@
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 Time

load --table Memos
[
{"_key": "Rroonga is fast!", "tag": "Rroonga", "date": "2014-11-17 00:00:00"},
{"_key": "Mroonga is fast!", "tag": "Mroonga", "date": "2014-11-16 00:00:00"},
{"_key": "Groonga is fast!", "tag": "Groonga", "date": "2014-11-16 00:00:00"},
{"_key": "Groonga sticker!", "tag": "Groonga", "date": "2014-11-16 00:00:00"},
{"_key": "Groonga is good!", "tag": "Groonga", "date": "2014-11-17 00:00:00"}
]

select Memos \
--filter true \
--drilldown[tag].keys tag,date \
--drilldown[tag].output_columns _key[0],_key[1],_nsubrecs \
--drilldown[tag].sortby _value.tag._key,_value.date
@@ -0,0 +1,121 @@
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 Time
[[0,0.0,0.0],true]
load --table Memos
[
{"_key": "Rroonga is fast!", "tag": "Rroonga", "date": "2014-11-17 00:00:00"},
{"_key": "Mroonga is fast!", "tag": "Mroonga", "date": "2014-11-16 00:00:00"},
{"_key": "Groonga is fast!", "tag": "Groonga", "date": "2014-11-16 00:00:00"},
{"_key": "Groonga sticker!", "tag": "Groonga", "date": "2014-11-16 00:00:00"},
{"_key": "Groonga is good!", "tag": "Groonga", "date": "2014-11-17 00:00:00"}
]
[[0,0.0,0.0],5]
select Memos --filter true --drilldowns[tag].keys tag,date --drilldowns[tag].output_columns _key[0],_key[1],_nsubrecs --drilldowns[tag].sortby _value.tag._key,_value.date
[
[
0,
0.0,
0.0
],
[
[
[
5
],
[
[
"_id",
"UInt32"
],
[
"_key",
"ShortText"
],
[
"date",
"Time"
],
[
"tag",
"Tags"
]
],
[
1,
"Rroonga is fast!",
1416150000.0,
"Rroonga"
],
[
2,
"Mroonga is fast!",
1416063600.0,
"Mroonga"
],
[
3,
"Groonga is fast!",
1416063600.0,
"Groonga"
],
[
4,
"Groonga sticker!",
1416063600.0,
"Groonga"
],
[
5,
"Groonga is good!",
1416150000.0,
"Groonga"
]
],
{
"tag": [
[
4
],
[
[
"_key[0]",
null
],
[
"_key[1]",
null
],
[
"_nsubrecs",
"Int32"
]
],
[
"Groonga",
1416063600.0,
2
],
[
"Groonga",
1416150000.0,
1
],
[
"Mroonga",
1416063600.0,
1
],
[
"Rroonga",
1416150000.0,
1
]
]
}
]
]
@@ -0,0 +1,20 @@
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 Time

load --table Memos
[
{"_key": "Rroonga is fast!", "tag": "Rroonga", "date": "2014-11-17 00:00:00"},
{"_key": "Mroonga is fast!", "tag": "Mroonga", "date": "2014-11-16 00:00:00"},
{"_key": "Groonga is fast!", "tag": "Groonga", "date": "2014-11-16 00:00:00"},
{"_key": "Groonga sticker!", "tag": "Groonga", "date": "2014-11-16 00:00:00"},
{"_key": "Groonga is good!", "tag": "Groonga", "date": "2014-11-17 00:00:00"}
]

select Memos \
--filter true \
--drilldowns[tag].keys tag,date \
--drilldowns[tag].output_columns _key[0],_key[1],_nsubrecs \
--drilldowns[tag].sortby _value.tag._key,_value.date
55 changes: 55 additions & 0 deletions test/command/suite/select/sortby/compressed.expected
@@ -0,0 +1,55 @@
table_create Users TABLE_HASH_KEY ShortText
[[0,0.0,0.0],true]
column_create Users name COLUMN_SCALAR|COMPRESS_ZLIB ShortText
[[0,0.0,0.0],true]
load --table Users
[
{"_key": "alice", "name": "Alice"},
{"_key": "kou", "name": "kou"},
{"_key": "mori", "name": "森"}
]
[[0,0.0,0.0],3]
select Users --sortby name
[
[
0,
0.0,
0.0
],
[
[
[
3
],
[
[
"_id",
"UInt32"
],
[
"_key",
"ShortText"
],
[
"name",
"ShortText"
]
],
[
1,
"alice",
"Alice"
],
[
2,
"kou",
"kou"
],
[
3,
"mori",
"森"
]
]
]
]
11 changes: 11 additions & 0 deletions test/command/suite/select/sortby/compressed.test
@@ -0,0 +1,11 @@
table_create Users TABLE_HASH_KEY ShortText
column_create Users name COLUMN_SCALAR|COMPRESS_ZLIB ShortText

load --table Users
[
{"_key": "alice", "name": "Alice"},
{"_key": "kou", "name": "kou"},
{"_key": "mori", "name": "森"}
]

select Users --sortby name
37 changes: 37 additions & 0 deletions test/command/suite/select/sortby/geo/distance/limit.expected
@@ -0,0 +1,37 @@
select LandMarks --sortby 'geo_distance(point, "0x0")' --limit 3
[
[
0,
0.0,
0.0
],
[
[
[
11
],
[
[
"_id",
"UInt32"
],
[
"point",
"WGS84GeoPoint"
]
],
[
1,
"0x0"
],
[
2,
"-1x1"
],
[
3,
"1x2"
]
]
]
]
3 changes: 3 additions & 0 deletions test/command/suite/select/sortby/geo/distance/limit.test
@@ -0,0 +1,3 @@
#@include fixture/geo/sort/init.grn

select LandMarks --sortby 'geo_distance(point, "0x0")' --limit 3

0 comments on commit eb8f465

Please sign in to comment.