Skip to content

Commit 5a0d434

Browse files
committed
Add tests
1 parent bd5082d commit 5a0d434

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test-syntax.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ TEST(SyntaxTest, SimpleCases) {
184184
EXPECT_EQ(
185185
"1",
186186
render(R"({{ 1 | safe }})", {}, {}));
187+
EXPECT_EQ(
188+
"True,False",
189+
render(R"({{ 'abc'.startswith('ab') }},{{ ''.startswith('a') }})", {}, {}));
187190
EXPECT_EQ(
188191
"True,False",
189192
render(R"({{ 'abc'.endswith('bc') }},{{ ''.endswith('a') }})", {}, {}));
@@ -465,6 +468,9 @@ TEST(SyntaxTest, SimpleCases) {
465468
EXPECT_EQ(
466469
"[1, 2, 3][0, 1][1, 2]",
467470
render("{% set x = [0, 1, 2, 3] %}{{ x[1:] }}{{ x[:2] }}{{ x[1:3] }}", {}, {}));
471+
EXPECT_EQ(
472+
"[3, 2, 1, 0][3, 2, 1][2, 1, 0][2, 1]",
473+
render("{% set x = [0, 1, 2, 3] %}{{ x[::-1] }}{{ x[:0:-1] }}{{ x[2::-1] }}{{ x[2:0:-1] }}", {}, {}));
468474
EXPECT_EQ(
469475
"a",
470476
render("{{ ' a ' | trim }}", {}, {}));

0 commit comments

Comments
 (0)