Zachary Tong f4c5cde8af [TEST] Replace folded blocks with literal blocks
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.
2014-05-02 18:30:48 -04:00

191 lines
3.3 KiB
YAML
Executable File

---
"Help":
- do:
cat.aliases:
help: true
- match:
$body: |
/^ alias .+ \n
index .+ \n
filter .+ \n
routing.index .+ \n
routing.search .+ \n
$/
---
"Empty cluster":
- do:
cat.aliases: {}
- match:
$body: |
/^
$/
---
"Simple alias":
- do:
indices.create:
index: test
- do:
indices.put_alias:
index: test
name: test_alias
- do:
cat.aliases: {}
- match:
$body: |
/^
test_alias \s+
test \s+
- \s+
- \s+
- \s+
$/
---
"Complex alias":
- do:
indices.create:
index: test
- do:
indices.put_alias:
index: test
name: test_alias
body:
index_routing: ir
search_routing: "sr1,sr2"
filter:
term:
foo: bar
- do:
cat.aliases: {}
- match:
$body: |
/^
test_alias \s+
test \s+
[*] \s+
ir \s+
sr1,sr2 \s+
$/
---
"Alias name":
- do:
indices.create:
index: test
- do:
indices.put_alias:
index: test
name: test_1
- do:
indices.put_alias:
index: test
name: test_2
- do:
cat.aliases:
name: test_1
- match:
$body: /^test_1 .+ \n$/
- do:
cat.aliases:
name: test_2
- match:
$body: /^test_2 .+ \n$/
- do:
cat.aliases:
name: test_*
- match:
$body: / (^|\n)test_1 .+ \n/
- match:
$body: / (^|\n)test_2 .+ \n/
---
"Column headers":
- do:
indices.create:
index: test
- do:
indices.put_alias:
index: test
name: test_1
- do:
cat.aliases:
v: true
- match:
$body: |
/^ alias \s+
index \s+
filter \s+
routing.index \s+
routing.search \s+
\n
test_1 \s+
test \s+
- \s+
- \s+
- \s+
$/
---
"Select columns":
- do:
indices.create:
index: test
- do:
indices.put_alias:
index: test
name: test_1
- do:
cat.aliases:
h: [index, alias]
- match:
$body: /^ test \s+ test_1 \s+ $/
- do:
cat.aliases:
h: [index, alias]
v: true
- match:
$body: |
/^
index \s+ alias \s+ \n
test \s+ test_1 \s+ \n
$/