null+****@clear*****
null+****@clear*****
2012年 3月 5日 (月) 19:05:19 JST
Kouhei Sutou 2012-03-05 19:05:19 +0900 (Mon, 05 Mar 2012) New Revision: 4780774a3352fb48b1798ada138273f64da12480 Log: [functional][test] add Added files: test/function/Makefile.am test/function/fixture/Makefile.am test/function/fixture/geo/Makefile.am test/function/fixture/geo/taiyaki/Makefile.am test/function/fixture/geo/taiyaki/areas.grn test/function/fixture/geo/taiyaki/categories.grn test/function/fixture/geo/taiyaki/ddl.grn test/function/fixture/geo/taiyaki/shops.grn test/function/fixture/geo/taiyaki/synonyms.grn test/function/include/Makefile.am test/function/include/geo/Makefile.am test/function/include/geo/taiyaki/Makefile.am test/function/include/geo/taiyaki/init.grn test/function/run-test.sh test/function/suite/Makefile.am test/function/suite/geo/Makefile.am test/function/suite/geo/taiyaki/Makefile.am test/function/suite/geo/taiyaki/in-circle.result test/function/suite/geo/taiyaki/in-circle.test test/function/suite/geo/taiyaki/in-rectangle-long-latitude.result test/function/suite/geo/taiyaki/in-rectangle-long-latitude.test Modified files: .gitignore configure.ac test/Makefile.am Modified: .gitignore (+1 -0) =================================================================== --- .gitignore 2012-03-05 19:04:23 +0900 (d08f6b6) +++ .gitignore 2012-03-05 19:05:19 +0900 (e66c6a9) @@ -109,3 +109,4 @@ version.sh /src/suggest/groonga-suggest-create-dataset /tmp-doc/ /test/unit/Gemfile.lock +/test/function/groonga-test/ Modified: configure.ac (+13 -0) =================================================================== --- configure.ac 2012-03-05 19:04:23 +0900 (863bb28) +++ configure.ac 2012-03-05 19:05:19 +0900 (6b88165) @@ -250,6 +250,16 @@ AC_CONFIG_FILES([ test/unit/gqtp/Makefile test/unit/story/Makefile test/unit/grntest/Makefile + test/function/Makefile + test/function/fixture/Makefile + test/function/fixture/geo/Makefile + test/function/fixture/geo/taiyaki/Makefile + test/function/include/Makefile + test/function/include/geo/Makefile + test/function/include/geo/taiyaki/Makefile + test/function/suite/Makefile + test/function/suite/geo/Makefile + test/function/suite/geo/taiyaki/Makefile test/benchmark/Makefile test/benchmark/fixtures/Makefile test/benchmark/fixtures/geo-select/Makefile @@ -685,6 +695,9 @@ AM_CONDITIONAL([WITH_UNIT_TEST], [test "$cutter_use_cutter" = "yes" -o \ "$ac_cv_ruby_available" = "yes"]) +AM_CONDITIONAL([WITH_FUNCTION_TEST], + [test "$ac_cv_ruby_available" = "yes"]) + # libedit AC_ARG_ENABLE(libedit, [AS_HELP_STRING([--disable-libedit], Modified: test/Makefile.am (+4 -1) =================================================================== --- test/Makefile.am 2012-03-05 19:04:23 +0900 (47fa42c) +++ test/Makefile.am 2012-03-05 19:05:19 +0900 (c6de775) @@ -1 +1,4 @@ -SUBDIRS = unit benchmark +SUBDIRS = \ + unit \ + function \ + benchmark Added: test/function/Makefile.am (+11 -0) 100644 =================================================================== --- /dev/null +++ test/function/Makefile.am 2012-03-05 19:05:19 +0900 (bba0994) @@ -0,0 +1,11 @@ +SUBDIRS = \ + fixture \ + include \ + suite + +if WITH_FUNCTION_TEST +TESTS = run-test.sh +endif + +EXTRA_DIST = \ + run-test.sh Added: test/function/fixture/Makefile.am (+2 -0) 100644 =================================================================== --- /dev/null +++ test/function/fixture/Makefile.am 2012-03-05 19:05:19 +0900 (31b7506) @@ -0,0 +1,2 @@ +SUBDIRS = \ + geo Added: test/function/fixture/geo/Makefile.am (+2 -0) 100644 =================================================================== --- /dev/null +++ test/function/fixture/geo/Makefile.am 2012-03-05 19:05:19 +0900 (d330fab) @@ -0,0 +1,2 @@ +SUBDIRS = \ + taiyaki Added: test/function/fixture/geo/taiyaki/Makefile.am (+6 -0) 100644 =================================================================== --- /dev/null +++ test/function/fixture/geo/taiyaki/Makefile.am 2012-03-05 19:05:19 +0900 (633678a) @@ -0,0 +1,6 @@ +EXTRA_DIST = \ + ddl.grn \ + shops.grn \ + areas.grn \ + categories.grn \ + synonyms.grn Added: test/function/fixture/geo/taiyaki/areas.grn (+26 -0) 100644 =================================================================== --- /dev/null +++ test/function/fixture/geo/taiyaki/areas.grn 2012-03-05 19:05:19 +0900 (4d56418) @@ -0,0 +1,26 @@ +load --table Areas +[ +{"_key":"area0001",name:"東京都千代田区"}, +{"_key":"area0002",name:"東京都中央区"}, +{"_key":"area0003",name:"東京都港区"}, +{"_key":"area0004",name:"東京都新宿区"}, +{"_key":"area0005",name:"東京都文京区"}, +{"_key":"area0006",name:"東京都台東区"}, +{"_key":"area0007",name:"東京都墨田区"}, +{"_key":"area0008",name:"東京都江東区"}, +{"_key":"area0009",name:"東京都品川区"}, +{"_key":"area0010",name:"東京都目黒区"}, +{"_key":"area0011",name:"東京都大田区"}, +{"_key":"area0012",name:"東京都世田谷区"}, +{"_key":"area0013",name:"東京都渋谷区"}, +{"_key":"area0014",name:"東京都中野区"}, +{"_key":"area0015",name:"東京都杉並区"}, +{"_key":"area0016",name:"東京都豊島区"}, +{"_key":"area0017",name:"東京都北区"}, +{"_key":"area0018",name:"東京都千代田区"}, +{"_key":"area0019",name:"東京都荒川区"}, +{"_key":"area0020",name:"東京都板橋区"}, +{"_key":"area0021",name:"東京都練馬区"}, +{"_key":"area0022",name:"東京都足立区"}, +{"_key":"area0023",name:"東京都江戸川区"}, +] Added: test/function/fixture/geo/taiyaki/categories.grn (+6 -0) 100644 =================================================================== --- /dev/null +++ test/function/fixture/geo/taiyaki/categories.grn 2012-03-05 19:05:19 +0900 (2afbb29) @@ -0,0 +1,6 @@ +load --table Categories +[ +{"_key":"category0001",name:"和食"}, +{"_key":"category0002",name:"中華"}, +{"_key":"category0003",name:"おやつ"} +] Added: test/function/fixture/geo/taiyaki/ddl.grn (+36 -0) 100644 =================================================================== --- /dev/null +++ test/function/fixture/geo/taiyaki/ddl.grn 2012-03-05 19:05:19 +0900 (bb373b8) @@ -0,0 +1,36 @@ +table_create Bigram TABLE_PAT_KEY|KEY_NORMALIZE ShortText --default_tokenizer TokenBigram + +table_create Locations TABLE_PAT_KEY WGS84GeoPoint + +table_create Tags TABLE_PAT_KEY ShortText +column_create Tags name COLUMN_SCALAR ShortText + +table_create Categories TABLE_HASH_KEY ShortText +column_create Categories name COLUMN_SCALAR ShortText + +table_create Areas TABLE_HASH_KEY ShortText +column_create Areas name COLUMN_SCALAR ShortText + +table_create Shops TABLE_HASH_KEY ShortText +column_create Shops name COLUMN_SCALAR ShortText +column_create Shops tags COLUMN_VECTOR Tags +column_create Shops location COLUMN_SCALAR WGS84GeoPoint +column_create Shops location1 COLUMN_SCALAR WGS84GeoPoint +column_create Shops location2 COLUMN_SCALAR WGS84GeoPoint +column_create Shops location3 COLUMN_SCALAR WGS84GeoPoint +column_create Shops latitude COLUMN_SCALAR Int32 +column_create Shops longitude COLUMN_SCALAR Int32 +column_create Shops latitude_in_degree COLUMN_SCALAR Float +column_create Shops longitude_in_degree COLUMN_SCALAR Float +column_create Shops categories COLUMN_VECTOR Categories +column_create Shops area COLUMN_SCALAR Areas + +table_create Synonyms TABLE_HASH_KEY ShortText +column_create Synonyms words COLUMN_SCALAR ShortText + +column_create Tags index COLUMN_INDEX Shops tags +column_create Locations shop COLUMN_INDEX Shops location +column_create Locations shop1 COLUMN_INDEX Shops location1 +column_create Locations shop2 COLUMN_INDEX Shops location2 +column_create Locations shop3 COLUMN_INDEX Shops location3 +column_create Bigram name COLUMN_INDEX|WITH_POSITION|WITH_SECTION Shops name Added: test/function/fixture/geo/taiyaki/shops.grn (+308 -0) 100644 =================================================================== --- /dev/null +++ test/function/fixture/geo/taiyaki/shops.grn 2012-03-05 19:05:19 +0900 (4faea42) @@ -0,0 +1,308 @@ +load --table Shops +[ +{"_key":"nezu-no-taiyaki", + "name":"根津のたいやき", + "latitude":128592911, + "longitude":503145263, + "location":"128592911x503145263", + "latitude_in_degree":35.720253, + "longitude_in_degree":139.762573, + "tags":["たいやき","天然"], + "area":"area0005"}, +{"_key":"taiyaki-kataoka", + "name":"たい焼 カタオカ", + "latitude":128565076, + "longitude":502976128, + "location":"128565076x502976128", + "latitude_in_degree":35.712521, + "longitude_in_degree":139.715591, + "tags":["たいやき"]}, +{"_key":"soba-taiyaki-ku", + "name":"そばたいやき空", + "latitude":128461363, + "longitude":502772717, + "location":"128461363x502772717", + "latitude_in_degree":35.683712, + "longitude_in_degree":139.659088, + "tags":["たいやき"]}, +{"_key":"kuruma", + "name":"車", + "latitude":128597458, + "longitude":502942345, + "location":"128597458x502942345", + "latitude_in_degree":35.721516, + "longitude_in_degree":139.706207, + "tags":["たいやき"]}, +{"_key":"hirose-ya", + "name":"広瀬屋", + "latitude":128573438, + "longitude":502868189, + "location":"128573438x502868189", + "latitude_in_degree":35.714844, + "longitude_in_degree":139.685608, + "tags":["たいやき"]}, +{"_key":"sazare", + "name":"さざれ", + "latitude":128572751, + "longitude":502866155, + "location":"128572751x502866155", + "latitude_in_degree":35.714653, + "longitude_in_degree":139.685043, + "tags":["たいやき"]}, +{"_key":"omede-taiyaki", + "name":"おめで鯛焼き本舗錦糸町東急店", + "latitude":128521858, + "longitude":503341754, + "location":"128521858x503341754", + "latitude_in_degree":35.700516, + "longitude_in_degree":139.817154, + "tags":["たいやき"]}, +{"_key":"onaga-ya", + "name":"尾長屋 錦糸町店", + "latitude":128513714, + "longitude":503319780, + "location":"128513714x503319780", + "latitude_in_degree":35.698254, + "longitude_in_degree":139.811050, + "tags":["たいやき","白"]}, +{"_key":"shiro-ya", + "name":"たいやき工房白家 阿佐ヶ谷店", + "latitude":128539861, + "longitude":502699000, + "location":"128539861x502699000", + "latitude_in_degree":35.705517, + "longitude_in_degree":139.638611, + "tags":["たいやき","白"]}, +{"_key":"fuji-ya", + "name":"たいやき本舗 藤家 阿佐ヶ谷店", + "latitude":128534177, + "longitude":502693614, + "location":"128534177x502693614", + "latitude_in_degree":35.703938, + "longitude_in_degree":139.637115, + "tags":["たいやき","白"]}, +{"_key":"miyoshi", + "name":"みよし", + "latitude":128320340, + "longitude":502334363, + "location":"128320340x502334363", + "latitude_in_degree":35.644539, + "longitude_in_degree":139.537323, + "tags":["たいやき"]}, +{"_key":"juju-ya", + "name":"寿々屋 菓子", + "latitude":128264119, + "longitude":502904718, + "location":"128264119x502904718", + "latitude_in_degree":35.628922, + "longitude_in_degree":139.695755, + "tags":["たいやき"]}, +{"_key":"tatsumi-ya", + "name":"たい焼き \/ たつみや", + "latitude":128395804, + "longitude":502699165, + "location":"128395804x502699165", + "latitude_in_degree":35.665501, + "longitude_in_degree":139.638657, + "tags":["たいやき"]}, +{"_key":"tetsuji", + "name":"たい焼き鉄次 大丸東京店", + "latitude":128451283, + "longitude":503166852, + "location":"128451283x503166852", + "latitude_in_degree":35.680912, + "longitude_in_degree":139.768570, + "tags":["たいやき"], + "categories":["category0003", + "category0001"]}, +{"_key":"gazuma-ya", + "name":"吾妻屋", + "latitude":128522941, + "longitude":502731353, + "location":"128522941x502731353", + "latitude_in_degree":35.700817, + "longitude_in_degree":139.647598, + "tags":["たいやき"]}, +{"_key":"honma-mon", + "name":"ほんま門", + "latitude":128601850, + "longitude":502749263, + "location":"128601850x502749263", + "latitude_in_degree":35.722736, + "longitude_in_degree":139.652573, + "tags":["たこやき"], + "area":"area0014"}, +{"_key":"naniwa-ya", + "name":"浪花家", + "latitude":128628220, + "longitude":503266442, + "location":"128628220x503266442", + "latitude_in_degree":35.730061, + "longitude_in_degree":139.796234, + "tags":["たいやき","天然"]}, +{"_key":"kuro-dai", + "name":"代官山たい焼き黒鯛", + "latitude":128341242, + "longitude":502937402, + "location":"128341242x502937402", + "latitude_in_degree":35.650345, + "longitude_in_degree":139.704834, + "tags":["たいやき"]}, +{"_key":"daruma", + "name":"たいやき神田達磨 八重洲店", + "latitude":128453260, + "longitude":503174156, + "location":"128453260x503174156", + "location1":"35.68157x139.76587", + "location2":"35.68481x139.76681", + "location3":"35.68276x139.77411", + "latitude_in_degree":35.681461, + "longitude_in_degree":139.770599, + "tags":["たいやき"]}, +{"_key":"yanagi-ya", + "name":"柳屋 たい焼き", + "latitude":128467228, + "longitude":503222332, + "location":"128467228x503222332", + "latitude_in_degree":35.685341, + "longitude_in_degree":139.783981, + "tags":["たいやき","天然"], + "area":"area0002"}, +{"_key":"sharaku", + "name":"たい焼き写楽", + "latitude":128581088, + "longitude":503261446, + "location":"128581088x503261446", + "latitude_in_degree":35.716969, + "longitude_in_degree":139.794846, + "tags":["たいやき","天然"]}, +{"_key":"takane", + "name":"たかね 和菓子", + "latitude":128514964, + "longitude":502419287, + "location":"128514964x502419287", + "latitude_in_degree":35.698601, + "longitude_in_degree":139.560913, + "tags":["たいやき","天然","和菓子"]}, +{"_key":"chiyoda", + "name":"たい焼き ちよだ", + "latitude":128313364, + "longitude":502750141, + "location":"128313364x502750141", + "latitude_in_degree":35.642601, + "longitude_in_degree":139.652817, + "tags":["たいやき"]}, +{"_key":"da-ka-po", + "name":"ダ・カーポ", + "latitude":128258446, + "longitude":503018482, + "location":"128258446x503018482", + "latitude_in_degree":35.627346, + "longitude_in_degree":139.727356, + "tags":["たいやき","カレー"]}, +{"_key":"matsushima-ya", + "name":"松島屋", + "latitude":128306002, + "longitude":503054572, + "location":"128306002x503054572", + "latitude_in_degree":35.640556, + "longitude_in_degree":139.737381, + "tags":["和菓子"], + "categories":["和食"]}, +{"_key":"kazuya", + "name":"銀座 かずや", + "latitude":128424629, + "longitude":503139222, + "location":"128424629x503139222", + "latitude_in_degree":35.673508, + "longitude_in_degree":139.760895, + "tags":["和菓子"], + "categories":["和食"]}, +{"_key":"furuya-kogane-an", + "name":"ふるや古賀音庵 和菓子", + "latitude":128450171, + "longitude":502833856, + "location":"128450171x502833856", + "latitude_in_degree":35.680603, + "longitude_in_degree":139.676071, + "tags":["和菓子"], + "categories":["和食"]}, +{"_key":"hachi-no-ie", + "name":"蜂の家 自由が丘本店", + "latitude":128188876, + "longitude":502805182, + "location":"128188876x502805182", + "latitude_in_degree":35.608021, + "longitude_in_degree":139.668106, + "tags":["和菓子"], + "categories":["和食"]}, +{"_key":"azuki-chan", + "name":"薄皮たい焼き あづきちゃん", + "latitude":128309436, + "longitude":502823531, + "location":"128309436x502823531", + "latitude_in_degree":35.641510, + "longitude_in_degree":139.673203, + "tags":["たいやき"]}, +{"_key":"kuriko-an", + "name":"横浜 くりこ庵 浅草店", + "latitude":128563247, + "longitude":503268584, + "location":"128563247x503268584", + "location1":"35.71916x139.79849", + "latitude_in_degree":35.712013, + "longitude_in_degree":139.796829, + "tags":["たいやき"]}, +{"_key":"yume-no-aru-machi-no-taiyaki-ya-san", + "name":"夢ある街のたいやき屋さん戸越銀座店", + "latitude":128218316, + "longitude":502965086, + "location":"128218316x502965086", + "latitude_in_degree":35.616199, + "longitude_in_degree":139.712524, + "tags":["たいやき"]}, +{"_key":"naze-ya", + "name":"何故屋", + "latitude":128192540, + "longitude":502796999, + "location":"128192540x502796999", + "latitude_in_degree":35.609039, + "longitude_in_degree":139.665833, + "tags":["たいやき"]}, +{"_key":"sanoki-ya", + "name":"築地 さのきや", + "latitude":128397312, + "longitude":503174596, + "location":"128397312x503174596", + "latitude_in_degree":35.665920, + "longitude_in_degree":139.770721, + "tags":["たいやき","マグロ"], + "categories":"", + "area":"area0002"}, +{"_key":"shigeta", + "name":"しげ田", + "latitude":128421454, + "longitude":503208983, + "location":"128421454x503208983", + "latitude_in_degree":35.672626, + "longitude_in_degree":139.780273, + "tags":["たいやき","和菓子"], + "area":"area0002"}, +{"_key":"nishimi-ya", + "name":"にしみや 甘味処", + "latitude":128418570, + "longitude":503188661, + "location":"128418570x503188661", + "latitude_in_degree":35.671825, + "longitude_in_degree":139.774628, + "tags":["たいやき","おでん"]}, +{"_key":"hiiragi", + "name":"たいやきひいらぎ", + "latitude":128331724, + "longitude":502961461, + "location":"128331724x502961461", + "latitude_in_degree":35.647701, + "longitude_in_degree":139.711517, + "tags":["たいやき"], + "area":"area0013"} +] Added: test/function/fixture/geo/taiyaki/synonyms.grn (+5 -0) 100644 =================================================================== --- /dev/null +++ test/function/fixture/geo/taiyaki/synonyms.grn 2012-03-05 19:05:19 +0900 (c5e6fc3) @@ -0,0 +1,5 @@ +load --table Synonyms +[ +{"_key":"たいやき", + "words":"(たいやき OR たい焼 OR 鯛焼き)"} +] Added: test/function/include/Makefile.am (+2 -0) 100644 =================================================================== --- /dev/null +++ test/function/include/Makefile.am 2012-03-05 19:05:19 +0900 (31b7506) @@ -0,0 +1,2 @@ +SUBDIRS = \ + geo Added: test/function/include/geo/Makefile.am (+2 -0) 100644 =================================================================== --- /dev/null +++ test/function/include/geo/Makefile.am 2012-03-05 19:05:19 +0900 (d330fab) @@ -0,0 +1,2 @@ +SUBDIRS = \ + taiyaki Added: test/function/include/geo/taiyaki/Makefile.am (+2 -0) 100644 =================================================================== --- /dev/null +++ test/function/include/geo/taiyaki/Makefile.am 2012-03-05 19:05:19 +0900 (4c948f4) @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + init.grn Added: test/function/include/geo/taiyaki/init.grn (+7 -0) 100644 =================================================================== --- /dev/null +++ test/function/include/geo/taiyaki/init.grn 2012-03-05 19:05:19 +0900 (3acb375) @@ -0,0 +1,7 @@ +# disable-logging +# include fixture/geo/taiyaki/ddl.grn +# include fixture/geo/taiyaki/areas.grn +# include fixture/geo/taiyaki/categories.grn +# include fixture/geo/taiyaki/shops.grn +# include fixture/geo/taiyaki/synonyms.grn +# enable-logging Added: test/function/run-test.sh (+56 -0) 100755 =================================================================== --- /dev/null +++ test/function/run-test.sh 2012-03-05 19:05:19 +0900 (8a536d7) @@ -0,0 +1,56 @@ +#!/bin/sh + +export BASE_DIR="`dirname $0`" +if test -z "$BUILD_DIR"; then + BUILD_DIR="$BASE_DIR" +fi +export BUILD_DIR + +top_dir="$BUILD_DIR/../.." +top_dir=$(cd -P "$top_dir" 2>/dev/null || cd "$top_dir"; pwd) + +if test x"$NO_MAKE" != x"yes"; then + make -C $top_dir > /dev/null || exit 1 +fi + +if test -z "$CUTTER"; then + CUTTER="`make -s -C $top_dir echo-cutter`" +fi +export CUTTER + +if test -z "$RUBY"; then + RUBY="`make -s -C $top_dir echo-ruby`" +fi +export RUBY + +if test -z "$GROONGA"; then + GROONGA="`make -s -C $top_dir echo-groonga`" +fi +export GROONGA + +GRN_PLUGINS_DIR="$top_dir/plugins" +export GRN_PLUGINS_DIR + +case `uname` in + Darwin) + DYLD_LIBRARY_PATH="$top_dir/lib/.libs:$DYLD_LIBRARY_PATH" + export DYLD_LIBRARY_PATH + ;; + *) + : + ;; +esac + +if test -z "$RUBY"; then + exit 1 +fi + +groonga_test_dir="$BASE_DIR/groonga-test" +if ! test -d "$groonga_test_dir"; then + git clone git://github.com/groonga/groonga-test.git "$groonga_test_dir" +fi + +$RUBY "$groonga_test_dir/bin/groonga-test" \ + --groonga "$GROONGA" \ + --base-directory "$BASE_DIR" \ + "$BASE_DIR/suite" "$@" Added: test/function/suite/Makefile.am (+2 -0) 100644 =================================================================== --- /dev/null +++ test/function/suite/Makefile.am 2012-03-05 19:05:19 +0900 (31b7506) @@ -0,0 +1,2 @@ +SUBDIRS = \ + geo Added: test/function/suite/geo/Makefile.am (+2 -0) 100644 =================================================================== --- /dev/null +++ test/function/suite/geo/Makefile.am 2012-03-05 19:05:19 +0900 (d330fab) @@ -0,0 +1,2 @@ +SUBDIRS = \ + taiyaki Added: test/function/suite/geo/taiyaki/Makefile.am (+5 -0) 100644 =================================================================== --- /dev/null +++ test/function/suite/geo/taiyaki/Makefile.am 2012-03-05 19:05:19 +0900 (bbf5683) @@ -0,0 +1,5 @@ +EXTRA_DIST = \ + in-circle.test \ + in-circle.result \ + in-rectangle-long-latitude.test \ + in-rectangle-long-latitude.result Added: test/function/suite/geo/taiyaki/in-circle.result (+64 -0) 100644 =================================================================== --- /dev/null +++ test/function/suite/geo/taiyaki/in-circle.result 2012-03-05 19:05:19 +0900 (a64b4dc) @@ -0,0 +1,64 @@ +select Shops --sortby '+_score, +name' --output_columns 'name, _score, location' --filter 'geo_in_circle(location, "35.67487,139.76352", 3000)' --scorer '_score=geo_distance(location, "35.67487,139.76352")' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 7 + ], + [ + [ + "name", + "ShortText" + ], + [ + "_score", + "Int32" + ], + [ + "location", + "WGS84GeoPoint" + ] + ], + [ + "銀座 かずや", + 280, + "128424629x503139222" + ], + [ + "たい焼き鉄次 大丸東京店", + 810, + "128451283x503166852" + ], + [ + "たいやき神田達磨 八重洲店", + 970, + "128453260x503174156" + ], + [ + "にしみや 甘味処", + 1056, + "128418570x503188661" + ], + [ + "築地 さのきや", + 1186, + "128397312x503174596" + ], + [ + "しげ田", + 1530, + "128421454x503208983" + ], + [ + "柳屋 たい焼き", + 2179, + "128467228x503222332" + ] + ] + ] +] Added: test/function/suite/geo/taiyaki/in-circle.test (+7 -0) 100644 =================================================================== --- /dev/null +++ test/function/suite/geo/taiyaki/in-circle.test 2012-03-05 19:05:19 +0900 (417c0d2) @@ -0,0 +1,7 @@ +# include include/geo/taiyaki/init.grn + +select Shops \ + --sortby '+_score, +name' \ + --output_columns 'name, _score, location' \ + --filter 'geo_in_circle(location, "35.67487,139.76352", 3000)' \ + --scorer '_score=geo_distance(location, "35.67487,139.76352")' Added: test/function/suite/geo/taiyaki/in-rectangle-long-latitude.result (+54 -0) 100644 =================================================================== --- /dev/null +++ test/function/suite/geo/taiyaki/in-rectangle-long-latitude.result 2012-03-05 19:05:19 +0900 (c97a6bd) @@ -0,0 +1,54 @@ +select Shops --sortby '+_score, +name' --output_columns 'name, _score, location' --filter 'geo_in_rectangle(location, "35.73360,139.7394", "35.62614,139.7714")' --scorer '_score=geo_distance(location, "35.69328,139.74968")' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 5 + ], + [ + [ + "name", + "ShortText" + ], + [ + "_score", + "Int32" + ], + [ + "location", + "WGS84GeoPoint" + ] + ], + [ + "たい焼き鉄次 大丸東京店", + 2186, + "128451283x503166852" + ], + [ + "たいやき神田達磨 八重洲店", + 2296, + "128453260x503174156" + ], + [ + "銀座 かずや", + 2415, + "128424629x503139222" + ], + [ + "根津のたいやき", + 3210, + "128592911x503145263" + ], + [ + "築地 さのきや", + 3579, + "128397312x503174596" + ] + ] + ] +] Added: test/function/suite/geo/taiyaki/in-rectangle-long-latitude.test (+7 -0) 100644 =================================================================== --- /dev/null +++ test/function/suite/geo/taiyaki/in-rectangle-long-latitude.test 2012-03-05 19:05:19 +0900 (29d2190) @@ -0,0 +1,7 @@ +# include include/geo/taiyaki/init.grn + +select Shops \ + --sortby '+_score, +name' \ + --output_columns 'name, _score, location' \ + --filter 'geo_in_rectangle(location, "35.73360,139.7394", "35.62614,139.7714")' \ + --scorer '_score=geo_distance(location, "35.69328,139.74968")'