From 573498a1d921748cb9067274748d93fff726fad7 Mon Sep 17 00:00:00 2001 From: Garren Smith Date: Mon, 30 Mar 2020 09:58:39 +0200 Subject: change _all_docs to raw collation --- src/fabric/src/fabric2_util.erl | 8 ++------ test/elixir/test/all_docs_test.exs | 3 ++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/fabric/src/fabric2_util.erl b/src/fabric/src/fabric2_util.erl index 46f9abeef..d74ef2718 100644 --- a/src/fabric/src/fabric2_util.erl +++ b/src/fabric/src/fabric2_util.erl @@ -294,13 +294,9 @@ uuid() -> to_hex(crypto:strong_rand_bytes(16)). -encode_all_doc_key(null) -> <<>>; -encode_all_doc_key(true) -> <<>>; -encode_all_doc_key(false) -> <<>>; -encode_all_doc_key(N) when is_number(N) -> <<>>; encode_all_doc_key(B) when is_binary(B) -> B; -encode_all_doc_key(L) when is_list(L) -> <<255>>; -encode_all_doc_key({O}) when is_list(O) -> <<255>>. +encode_all_doc_key(Term) when Term < <<>> -> <<>>; +encode_all_doc_key(_) -> <<255>>. pmap(Fun, Args) -> diff --git a/test/elixir/test/all_docs_test.exs b/test/elixir/test/all_docs_test.exs index 9501b3bec..16641aa95 100644 --- a/test/elixir/test/all_docs_test.exs +++ b/test/elixir/test/all_docs_test.exs @@ -319,7 +319,8 @@ defmodule AllDocsTest do resp = Couch.get("/#{db_name}/_all_docs", query: %{:startkey => "[1,2]"}).body rows = resp["rows"] - assert length(rows) === 0 + assert length(rows) === 3 + assert get_ids(resp) == ["a", "m", "z"] resp = Couch.get("/#{db_name}/_all_docs", query: %{:end_key => 0}).body rows = resp["rows"] -- cgit v1.2.1