mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-06 13:08:29 +00:00
The regex tests are formatted with blocks for readability. Previously, they were formatted using folded style blocks (e.g. using `>`). Folded blocks convert newlines into spaces. This is problematic for our regex, since comments can only be terminated with a newline. Effectively, anything after a comment will be commented out, making many of the regex "silently pass". This commit replaces them with scalar-style blocks (e.g. using `|`), which treats newlines as significant, and thus correctly terminates comments inside the regex. Also fixes a regex test (`cat.thread_pool/10_basic.yaml`) that started to fail after the block was fixed. The test was missing a `\s+` before the closing newline.
77 lines
1.4 KiB
YAML
Executable File
77 lines
1.4 KiB
YAML
Executable File
---
|
|
"Test cat count help":
|
|
- do:
|
|
cat.count:
|
|
help: true
|
|
|
|
- match:
|
|
$body: |
|
|
/^ epoch .+ \n
|
|
timestamp .+ \n
|
|
count .+ \n $/
|
|
|
|
---
|
|
"Test cat count output":
|
|
|
|
- do:
|
|
cat.count: {}
|
|
|
|
- match:
|
|
$body: |
|
|
/# epoch timestamp count
|
|
^ \d+ \s \d{2}:\d{2}:\d{2} \s 0 \s $/
|
|
|
|
- do:
|
|
index:
|
|
index: index1
|
|
type: type1
|
|
id: 1
|
|
body: { foo: bar }
|
|
refresh: true
|
|
|
|
- do:
|
|
cat.count: {}
|
|
|
|
- match:
|
|
$body: |
|
|
/# epoch timestamp count
|
|
^ \d+ \s \d{2}:\d{2}:\d{2} \s 1 \s $/
|
|
|
|
- do:
|
|
index:
|
|
index: index2
|
|
type: type2
|
|
id: 1
|
|
body: { foo: bar }
|
|
refresh: true
|
|
|
|
- do:
|
|
cat.count:
|
|
h: count
|
|
|
|
- match:
|
|
$body: |
|
|
/# count
|
|
^ 2 \s $/
|
|
|
|
|
|
- do:
|
|
cat.count:
|
|
index: index1
|
|
|
|
- match:
|
|
$body: |
|
|
/# epoch timestamp count
|
|
^ \d+ \s \d{2}:\d{2}:\d{2} \s 1 \s $/
|
|
|
|
- do:
|
|
cat.count:
|
|
index: index2
|
|
v: true
|
|
|
|
- match:
|
|
$body: |
|
|
/^ epoch \s+ timestamp \s+ count \s+ \n
|
|
\d+ \s+ \d{2}:\d{2}:\d{2} \s+ \d+ \s+ \n $/
|
|
|