diff options
Diffstat (limited to 'vendor/gopkg.in/olivere/elastic.v5/search_queries_match_all_test.go')
-rw-r--r-- | vendor/gopkg.in/olivere/elastic.v5/search_queries_match_all_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/vendor/gopkg.in/olivere/elastic.v5/search_queries_match_all_test.go b/vendor/gopkg.in/olivere/elastic.v5/search_queries_match_all_test.go index 11cf5c5f7..5d8671025 100644 --- a/vendor/gopkg.in/olivere/elastic.v5/search_queries_match_all_test.go +++ b/vendor/gopkg.in/olivere/elastic.v5/search_queries_match_all_test.go @@ -42,3 +42,20 @@ func TestMatchAllQueryWithBoost(t *testing.T) { t.Errorf("expected\n%s\n,got:\n%s", expected, got) } } + +func TestMatchAllQueryWithQueryName(t *testing.T) { + q := NewMatchAllQuery().QueryName("qname") + src, err := q.Source() + if err != nil { + t.Fatal(err) + } + data, err := json.Marshal(src) + if err != nil { + t.Fatalf("marshaling to JSON failed: %v", err) + } + got := string(data) + expected := `{"match_all":{"_name":"qname"}}` + if got != expected { + t.Errorf("expected\n%s\n,got:\n%s", expected, got) + } +} |