2023-04-14 19:00:15 +04:00
|
|
|
use super::*;
|
|
|
|
|
|
|
|
#[tokio::test(flavor = "multi_thread")]
|
|
|
|
async fn auto_indent() -> anyhow::Result<()> {
|
|
|
|
let app = || AppBuilder::new().with_file("foo.yaml", None);
|
|
|
|
|
|
|
|
let below_tests = [
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {r##"
|
2023-04-14 19:00:15 +04:00
|
|
|
#[t|]#op:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"##},
|
2023-04-14 19:00:15 +04:00
|
|
|
"o",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
#[\n|]#
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {r##"
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
b#[a|]#z: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"##},
|
2023-04-14 19:00:15 +04:00
|
|
|
"o",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
#[\n|]#
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {r##"
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi#[:|]#
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"##},
|
2023-04-14 19:00:15 +04:00
|
|
|
"o",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
#[\n|]#
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {r##"
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: #[yes|]#
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"##},
|
2023-04-14 19:00:15 +04:00
|
|
|
"o",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
#[\n|]#
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {r##"
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: becaus#[e|]#
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"##},
|
2023-04-14 19:00:15 +04:00
|
|
|
"o",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
#[\n|]#
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:#[\n|]#
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"o",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
#[\n|]#
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1#[\n|]#
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"o",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
#[\n|]#
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:#[\n|]#
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"o",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
|
|
|
#[\n|]#
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bax: |
|
|
|
|
some
|
|
|
|
multi
|
|
|
|
line
|
|
|
|
string#[\n|]#
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"o",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bax: |
|
|
|
|
some
|
|
|
|
multi
|
|
|
|
line
|
|
|
|
string
|
|
|
|
#[\n|]#
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bax: >
|
|
|
|
some
|
|
|
|
multi
|
|
|
|
line#[\n|]#
|
|
|
|
string
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"o",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bax: >
|
|
|
|
some
|
|
|
|
multi
|
|
|
|
line
|
|
|
|
#[\n|]#
|
|
|
|
string
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bax: >#[\n|]#
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"o",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bax: >
|
|
|
|
#[\n|]#
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
- top:#[\n|]#
|
|
|
|
baz: foo
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"o",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
- top:
|
|
|
|
#[\n|]#
|
|
|
|
baz: foo
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
- top:
|
|
|
|
baz: foo#[\n|]#
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"o",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
- top:
|
|
|
|
baz: foo
|
|
|
|
#[\n|]#
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
- top:
|
|
|
|
baz: foo
|
|
|
|
bax: foox#[\n|]#
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"o",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
- top:
|
|
|
|
baz: foo
|
|
|
|
bax: foox
|
|
|
|
#[\n|]#
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz:
|
|
|
|
- one: two#[\n|]#
|
|
|
|
three: four
|
|
|
|
- top:
|
|
|
|
baz: foo
|
|
|
|
bax: foox
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"o",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz:
|
|
|
|
- one: two
|
|
|
|
#[\n|]#
|
|
|
|
three: four
|
|
|
|
- top:
|
|
|
|
baz: foo
|
|
|
|
bax: foox
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
// yaml map without a key
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:#[\n|]#
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"o",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
#[\n|]#
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top#[:|]#
|
|
|
|
bottom: withvalue
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"o",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
#[\n|]#
|
|
|
|
bottom: withvalue
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
bottom: withvalue
|
|
|
|
top#[:|]#
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"o",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
bottom: withvalue
|
|
|
|
top:
|
|
|
|
#[\n|]#
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
];
|
|
|
|
|
|
|
|
for test in below_tests {
|
|
|
|
test_with_config(app(), test).await?;
|
|
|
|
}
|
|
|
|
|
|
|
|
let above_tests = [
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {r##"
|
2023-04-14 19:00:15 +04:00
|
|
|
#[t|]#op:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"##},
|
2023-04-14 19:00:15 +04:00
|
|
|
"O",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
#[\n|]#
|
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {r##"
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
b#[a|]#z: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"##},
|
2023-04-14 19:00:15 +04:00
|
|
|
"O",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
#[\n|]#
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {r##"
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi#[:|]#
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"##},
|
2023-04-14 19:00:15 +04:00
|
|
|
"O",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
#[\n|]#
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {r##"
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: #[yes|]#
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"##},
|
2023-04-14 19:00:15 +04:00
|
|
|
"O",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
#[\n|]#
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {r##"
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: becaus#[e|]#
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"##},
|
2023-04-14 19:00:15 +04:00
|
|
|
"O",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
#[\n|]#
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:#[\n|]#
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"O",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
#[\n|]#
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1#[\n|]#
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"O",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
#[\n|]#
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
fook:#[\n|]#
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"O",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bazi:
|
|
|
|
more: yes
|
|
|
|
why: because
|
|
|
|
quux:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
bax: foox
|
|
|
|
#[\n|]#
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bax: |
|
|
|
|
some
|
|
|
|
multi
|
|
|
|
line
|
|
|
|
string#[\n|]#
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"O",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bax: |
|
|
|
|
some
|
|
|
|
multi
|
|
|
|
line
|
|
|
|
#[\n|]#
|
|
|
|
string
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bax: >
|
|
|
|
some#[\n|]#
|
|
|
|
multi
|
|
|
|
line
|
|
|
|
string
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"O",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bax: >
|
|
|
|
#[\n|]#
|
|
|
|
some
|
|
|
|
multi
|
|
|
|
line
|
|
|
|
string
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bax: >
|
|
|
|
fook:#[\n|]#
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"O",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz: foo
|
|
|
|
bax: >
|
|
|
|
#[\n|]#
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
- top:
|
|
|
|
baz: foo#[\n|]#
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"O",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
- top:
|
|
|
|
#[\n|]#
|
|
|
|
baz: foo
|
|
|
|
bax: foox
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
- top:
|
|
|
|
baz: foo
|
|
|
|
bax: foox
|
|
|
|
fook:#[\n|]#
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"O",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
- top:
|
|
|
|
baz: foo
|
|
|
|
bax: foox
|
|
|
|
#[\n|]#
|
|
|
|
fook:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz:
|
|
|
|
- one: two#[\n|]#
|
|
|
|
three: four
|
|
|
|
- top:
|
|
|
|
baz: foo
|
|
|
|
bax: foox
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"O",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
baz:
|
|
|
|
#[\n|]#
|
|
|
|
- one: two
|
|
|
|
three: four
|
|
|
|
- top:
|
|
|
|
baz: foo
|
|
|
|
bax: foox
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
// yaml map without a key
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:#[\n|]#
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"O",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
#[\n|]#
|
|
|
|
top:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
bottom: withvalue
|
|
|
|
top#[:|]#
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"O",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
bottom: withvalue
|
|
|
|
#[\n|]#
|
|
|
|
top:
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
bottom:#[ |]#withvalue
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"O",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
top:
|
|
|
|
#[\n|]#
|
|
|
|
bottom: withvalue
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
];
|
|
|
|
|
|
|
|
for test in above_tests {
|
|
|
|
test_with_config(app(), test).await?;
|
|
|
|
}
|
|
|
|
|
|
|
|
let enter_tests = [
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {r##"
|
2023-04-14 19:00:15 +04:00
|
|
|
foo: #[b|]#ar
|
2024-03-31 16:12:17 +04:00
|
|
|
"##},
|
2023-04-14 19:00:15 +04:00
|
|
|
"i<ret>",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
foo:
|
|
|
|
#[|b]#ar
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
(
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
foo:#[\n|]#
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
"i<ret>",
|
2024-03-31 16:12:17 +04:00
|
|
|
indoc! {"\
|
2023-04-14 19:00:15 +04:00
|
|
|
foo:
|
|
|
|
#[|\n]#
|
2024-03-31 16:12:17 +04:00
|
|
|
"},
|
2023-04-14 19:00:15 +04:00
|
|
|
),
|
|
|
|
];
|
|
|
|
|
|
|
|
for test in enter_tests {
|
|
|
|
test_with_config(app(), test).await?;
|
|
|
|
}
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|