Browse Source

Adding test for delimiters

KevBurnsJr 14 năm trước cách đây
mục cha
commit
a7cf3e7309
1 tập tin đã thay đổi với 9 bổ sung0 xóa
  1. 9 0
      test/MustacheTest.php

+ 9 - 0
test/MustacheTest.php

@@ -402,6 +402,15 @@ class MustacheTest extends PHPUnit_Framework_TestCase {
 		$this->assertEquals('success', $m->render('{{=<% %>=}}<% result %>'));
 	}
 
+	/**
+	 * @group delimiters
+	 */
+	public function testStickyDelimiters() {
+		$m = new Mustache(null, array('result' => 'FAIL'));
+		$this->assertEquals('{{ result }}', $m->render('{{=[[ ]]=}}{{ result }}[[={{ }}=]]'));
+		$this->assertEquals('{{ result }}', $m->render('{{=[[ ]]=}}{{#result}}FAIL{{/result}}{{result}}[[={{ }}=]]'));
+	}
+
 	/**
 	 * @group sections
 	 * @dataProvider poorlyNestedSections