@@ -183,6 +183,36 @@ public function testMatchRecursiveAnnotationVariationOpening()
183
183
static ::assertTrue ($ result ->isOpening ());
184
184
}
185
185
186
+ public function testMatchRecursiveAnnotationVariationOpeningWithSpaceAtBegin ()
187
+ {
188
+ // Arrange
189
+ $ buffer = ' ( ' ;
190
+
191
+ $ lexer = new StringLexer ($ buffer );
192
+
193
+ // Act
194
+ $ result = $ lexer ->getNextToken ();
195
+
196
+ // Assert
197
+ static ::assertInstanceOf (RecursiveAnnotationVariation::class, $ result );
198
+ static ::assertTrue ($ result ->isOpening ());
199
+ }
200
+
201
+ public function testMatchRecursiveAnnotationVariationOpeningWithSpaceAtEnd ()
202
+ {
203
+ // Arrange
204
+ $ buffer = '( ' ;
205
+
206
+ $ lexer = new StringLexer ($ buffer );
207
+
208
+ // Act
209
+ $ result = $ lexer ->getNextToken ();
210
+
211
+ // Assert
212
+ static ::assertInstanceOf (RecursiveAnnotationVariation::class, $ result );
213
+ static ::assertTrue ($ result ->isOpening ());
214
+ }
215
+
186
216
public function testMatchRecursiveAnnotationVariationClosing ()
187
217
{
188
218
// Arrange
@@ -198,6 +228,36 @@ public function testMatchRecursiveAnnotationVariationClosing()
198
228
static ::assertFalse ($ result ->isOpening ());
199
229
}
200
230
231
+ public function testMatchRecursiveAnnotationVariationClosingWithSpaceAtEnd ()
232
+ {
233
+ // Arrange
234
+ $ buffer = ') ' ;
235
+
236
+ $ lexer = new StringLexer ($ buffer );
237
+
238
+ // Act
239
+ $ result = $ lexer ->getNextToken ();
240
+
241
+ // Assert
242
+ static ::assertInstanceOf (RecursiveAnnotationVariation::class, $ result );
243
+ static ::assertFalse ($ result ->isOpening ());
244
+ }
245
+
246
+ public function testMatchRecursiveAnnotationVariationClosingWithSpaceAtBegin ()
247
+ {
248
+ // Arrange
249
+ $ buffer = ' ) ' ;
250
+
251
+ $ lexer = new StringLexer ($ buffer );
252
+
253
+ // Act
254
+ $ result = $ lexer ->getNextToken ();
255
+
256
+ // Assert
257
+ static ::assertInstanceOf (RecursiveAnnotationVariation::class, $ result );
258
+ static ::assertFalse ($ result ->isOpening ());
259
+ }
260
+
201
261
public function testMatchNumericAnnotationGlyph ()
202
262
{
203
263
// Arrange
@@ -213,6 +273,21 @@ public function testMatchNumericAnnotationGlyph()
213
273
static ::assertEquals (123 , $ result ->getValue ());
214
274
}
215
275
276
+ public function testMatchNumericAnnotationGlyphWithSpace ()
277
+ {
278
+ // Arrange
279
+ $ buffer = ' $123 ' ;
280
+
281
+ $ lexer = new StringLexer ($ buffer );
282
+
283
+ // Act
284
+ $ result = $ lexer ->getNextToken ();
285
+
286
+ // Assert
287
+ static ::assertInstanceOf (NumericAnnotationGlyph::class, $ result );
288
+ static ::assertEquals (123 , $ result ->getValue ());
289
+ }
290
+
216
291
public function testMatchSANCastling ()
217
292
{
218
293
// Arrange
0 commit comments