@@ -41,6 +41,47 @@ public function testExtract(): void {
4141 GE \Extractor::PLURAL => 'I see %d little indians! ' ,
4242 GE \Extractor::CONTEXT => 'context '
4343 ), $ messages );
44+
45+ self ::assertContains (array (
46+ GE \Extractor::LINE => 8 ,
47+ GE \Extractor::SINGULAR => 'A message! '
48+ ), $ messages );
49+
50+ self ::assertContains (array (
51+ GE \Extractor::LINE => 9 ,
52+ GE \Extractor::SINGULAR => 'Another message! ' ,
53+ GE \Extractor::CONTEXT => 'context '
54+ ), $ messages );
55+
56+ self ::assertContains (array (
57+ GE \Extractor::LINE => 10 ,
58+ GE \Extractor::SINGULAR => 'I see %d little indian! ' ,
59+ GE \Extractor::PLURAL => 'I see %d little indians! '
60+ ), $ messages );
61+
62+ self ::assertContains (array (
63+ GE \Extractor::LINE => 11 ,
64+ GE \Extractor::SINGULAR => 'I see %d little indian! ' ,
65+ GE \Extractor::PLURAL => 'I see %d little indians! ' ,
66+ GE \Extractor::CONTEXT => 'context '
67+ ), $ messages );
68+ }
69+
70+ public function testCustomMacros (): void {
71+ $ this ->object ->addFunction ('custom ' , 1 );
72+ $ this ->object ->addFunction ('!custom ' , 1 );
73+
74+ $ messages = $ this ->object ->extract (__DIR__ . '/../../data/latte/custom.latte ' );
75+
76+ self ::assertContains (array (
77+ GE \Extractor::LINE => 1 ,
78+ GE \Extractor::SINGULAR => 'A custom message! '
79+ ), $ messages );
80+
81+ self ::assertContains (array (
82+ GE \Extractor::LINE => 2 ,
83+ GE \Extractor::SINGULAR => 'An unescaped custom message! '
84+ ), $ messages );
4485 }
4586
4687 public function testNoValidMessages (): void {
0 commit comments