Skip to content

Commit

Permalink
Avoid using string 'y' in fields REST tests. (#60471)
Browse files Browse the repository at this point in the history
Some yaml parsers interpret 'y' and 'yes' as the boolean 'true'.
  • Loading branch information
jtibshirani committed Jul 31, 2020
1 parent 8db896d commit fe1d877
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ setup:
index: test
id: 1
body:
keyword: [ "x", "y" ]
keyword: [ "a", "b" ]
integer_range:
gte: 0
lte: 42
Expand All @@ -39,8 +39,8 @@ setup:
- is_true: hits.hits.0._id
- is_true: hits.hits.0._source

- match: { hits.hits.0.fields.keyword.0: x }
- match: { hits.hits.0.fields.keyword.1: y }
- match: { hits.hits.0.fields.keyword.0: a }
- match: { hits.hits.0.fields.keyword.1: b }

- match: { hits.hits.0.fields.integer_range.0.gte: 0 }
- match: { hits.hits.0.fields.integer_range.0.lte: 42 }
Expand Down Expand Up @@ -112,7 +112,7 @@ setup:
index: test
id: 1
body:
keyword: [ "x" ]
keyword: [ "a" ]

- do:
catch: bad_request
Expand Down Expand Up @@ -145,15 +145,15 @@ setup:
index: test
id: 1
body:
keyword: "x"
keyword: "a"
integer: 42

- do:
index:
index: test
id: 2
body:
keyword: "y"
keyword: "b"
integer: "not an integer"

- do:
Expand Down Expand Up @@ -192,7 +192,7 @@ setup:
id: 1
refresh: true
body:
keyword: "x"
keyword: "a"
integer: 42

- do:
Expand All @@ -202,7 +202,7 @@ setup:
fields: [ keyword ]
_source: false

- match: { hits.hits.0.fields.keyword.0: "x" }
- match: { hits.hits.0.fields.keyword.0: "a" }

- do:
search:
Expand All @@ -212,5 +212,5 @@ setup:
stored_fields: [ integer ]
_source: false

- match: { hits.hits.0.fields.keyword.0: "x" }
- match: { hits.hits.0.fields.keyword.0: "a" }
- match: { hits.hits.0.fields.integer.0: 42 }

0 comments on commit fe1d877

Please sign in to comment.