(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func TestQueryStringQuery(t *testing.T) { |
| 14 | q := NewQueryStringQuery(`this AND that OR thus`) |
| 15 | q = q.DefaultField("content") |
| 16 | src, err := q.Source() |
| 17 | if err != nil { |
| 18 | t.Fatal(err) |
| 19 | } |
| 20 | data, err := json.Marshal(src) |
| 21 | if err != nil { |
| 22 | t.Fatalf("marshaling to JSON failed: %v", err) |
| 23 | } |
| 24 | got := string(data) |
| 25 | expected := `{"query_string":{"default_field":"content","query":"this AND that OR thus"}}` |
| 26 | if got != expected { |
| 27 | t.Errorf("expected\n%s\n,got:\n%s", expected, got) |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | func TestQueryStringQueryTimeZone(t *testing.T) { |
| 32 | q := NewQueryStringQuery(`tweet_date:[2015-01-01 TO 2017-12-31]`) |
nothing calls this directly
no test coverage detected
searching dependent graphs…