diff options
| author | Philipp A | 2019-11-09 16:43:59 +0100 |
|---|---|---|
| committer | Philipp A | 2019-11-09 16:43:59 +0100 |
| commit | aedf9c79991482becbdb4b005fac9ca50cb53388 (patch) | |
| tree | a11f9504a42deeb8a8e330e8d60f2aaf7264666a /src/parser/tests.rs | |
| parent | 89d1ed48c5f37d4c4e0e81bd85d0658093299b34 (diff) | |
| download | rust-rst-aedf9c79991482becbdb4b005fac9ca50cb53388.tar.bz2 | |
Implement replace
Diffstat (limited to 'src/parser/tests.rs')
| -rw-r--r-- | src/parser/tests.rs | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/parser/tests.rs b/src/parser/tests.rs index c498159..ee33c8a 100644 --- a/src/parser/tests.rs +++ b/src/parser/tests.rs @@ -108,7 +108,32 @@ fn admonitions() { }; } -// TODO: test substitutions + +#[allow(clippy::cognitive_complexity)] +#[test] +fn substitutions() { + parses_to! { + parser: RstParser, + input: "\ +A |subst| in-line + +.. |subst| replace:: substitution +", + rule: Rule::document, + tokens: [ + paragraph(0, 17, [ + str(0, 2), + substitution_ref(2, 9, [ substitution_name(3, 8) ]), + str(9, 17), + ]), + substitution_def(19, 53, [ + substitution_name(23, 28), + replace(30, 53, [ line(39, 53, [str(39, 52)]) ]) + ]), + ] + }; +} + // TODO: test images #[allow(clippy::cognitive_complexity)] |
