Permalink
Browse files

Add a failing test for #183

Tokenization error for sections with only “0” in them.
  • Loading branch information...
1 parent dd528e7 commit f1d3955492b38c26cad5e7ca9c169ea5b97792c0 @bobthecow committed Jan 9, 2014
Showing with 29 additions and 0 deletions.
  1. +29 −0 test/Mustache/Test/TokenizerTest.php
@@ -159,6 +159,35 @@ public function getTokens()
)
),
+
+ // See https://github.com/bobthecow/mustache.php/issues/183
+ array(
+ "{{# a }}0{{/ a }}",
+ null,
+ array(
+ array(
+ Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_SECTION,
+ Mustache_Tokenizer::NAME => 'a',
+ Mustache_Tokenizer::OTAG => '{{',
+ Mustache_Tokenizer::CTAG => '}}',
+ Mustache_Tokenizer::LINE => 0,
+ Mustache_Tokenizer::INDEX => 8,
+ ),
+ array(
+ Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
+ Mustache_Tokenizer::LINE => 0,
+ Mustache_Tokenizer::VALUE => "0",
+ ),
+ array(
+ Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION,
+ Mustache_Tokenizer::NAME => 'a',
+ Mustache_Tokenizer::OTAG => '{{',
+ Mustache_Tokenizer::CTAG => '}}',
+ Mustache_Tokenizer::LINE => 0,
+ Mustache_Tokenizer::INDEX => 9,
+ ),
+ )
+ ),
);
}
}

0 comments on commit f1d3955

Please sign in to comment.