summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2020-09-15 22:52:27 +0200
committerLaria Carolin Chabowski <laria@laria.me>2020-09-15 23:14:59 +0200
commitd2d7170ae27803db5d041102d2456616ca89f323 (patch)
treebdfb91957cbd1010c84c47faa7138de5fc86321d /tests/unit
parentc6801426167f99f1ea3da8730f27877b594da055 (diff)
downloadste-d2d7170ae27803db5d041102d2456616ca89f323.tar.gz
ste-d2d7170ae27803db5d041102d2456616ca89f323.tar.bz2
ste-d2d7170ae27803db5d041102d2456616ca89f323.zip
Tests: Also test parsing pseudotags
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/ParserTest.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/unit/ParserTest.php b/tests/unit/ParserTest.php
index 1e41ad0..b559913 100644
--- a/tests/unit/ParserTest.php
+++ b/tests/unit/ParserTest.php
@@ -172,6 +172,21 @@ class ParserTest extends TestCase
]),
new VariableNode('-', 34, 'bar', []),
]],
+
+ ['<ste:comment>ignored</ste:comment>', []],
+
+ ['foo<ste:comment>ignored</ste:comment>bar', [
+ // These are not two TextNodes as the parser will collapse adjacent TextNodes
+ new TextNode('-', 0, 'foobar'),
+ ]],
+
+ ['<ste:rawtext><ste:foo a="bla">$abc</ste:foo></ste:rawtext>', [
+ new TextNode('-', 0, '<ste:foo a="bla">$abc</ste:foo>'),
+ ]],
+
+ ['<ste:rawtext><ste:foo a="bla"><ste:rawtext>$abc</ste:foo></ste:rawtext>', [
+ new TextNode('-', 0, '<ste:foo a="bla"><ste:rawtext>$abc</ste:foo>'),
+ ]],
];
}
@@ -252,6 +267,10 @@ class ParserTest extends TestCase
['~{foo|'],
['~{foo}'],
['~{'],
+
+ // Unclosing pseudotags
+ ['<ste:comment>foo'],
+ ['<ste:rawtext>foo'],
];
}
}