Navigation Menu

Skip to content

Commit

Permalink
test: Fix expected convert results
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 28, 2014
1 parent 40fb843 commit d3fb84f
Showing 1 changed file with 33 additions and 25 deletions.
58 changes: 33 additions & 25 deletions test/unit/plugins/groonga/select/test_adapter_output.rb
Expand Up @@ -45,7 +45,9 @@ def test_empty
headers = [["_id","UInt32"]]
expected_select_response = [
[status_code, start_time_in_unix_time, elapsed_time],
[[[count], headers]],
[
[[count], headers],
],
]

assert_equal(expected_select_response, convert(search_response))
Expand Down Expand Up @@ -77,7 +79,7 @@ def expected_header

def expected_main_select_result
headers = [["_id","UInt32"]]
[[[COUNT], headers]]
[[COUNT], headers]
end

def test_no_drilldown
Expand All @@ -87,7 +89,9 @@ def test_no_drilldown

expected_select_response = [
expected_header,
expected_main_select_result,
[
expected_main_select_result,
],
]

assert_equal(expected_select_response, convert(search_response))
Expand All @@ -111,23 +115,25 @@ def test_have_one_result
},
}

header = [
headers = [
["_id", "UInt32"],
["_key", "ShortText"],
["_nsubrecs", "UInt32"],
]
expected_select_response = [
expected_header,
expected_main_select_result,
[
[3],
header,
expected_main_select_result,
[
[1, "a1", 10],
[2, "a2", 20],
[3, "a3", 30],
[3],
headers,
[
[1, "a1", 10],
[2, "a2", 20],
[3, "a3", 30],
],
],
]
],
]

assert_equal(expected_select_response, convert(search_response))
Expand Down Expand Up @@ -161,30 +167,32 @@ def test_have_multiple_results
},
}

header = [
headers = [
["_key", "ShortText"],
["_nsubrecs", "UInt32"],
]
expected_select_response = [
expected_header,
expected_main_select_result,
[
[3],
header,
expected_main_select_result,
[
["a1", 10],
["a2", 20],
["a3", 30],
[3],
headers,
[
["a1", 10],
["a2", 20],
["a3", 30],
],
],
],
[
[2],
header,
[
["b1", 10],
["b2", 20],
[2],
headers,
[
["b1", 10],
["b2", 20],
],
],
]
],
]

assert_equal(expected_select_response, convert(search_response))
Expand Down

0 comments on commit d3fb84f

Please sign in to comment.