@@ -324,6 +324,34 @@ TEST(DeclSyntaxTests, FunctionParameterWithAPIs) {
324
324
}
325
325
}
326
326
327
+ TEST (DeclSyntaxTests, FunctionParameterWithEllipsis) {
328
+ auto ExternalName = SyntaxFactory::makeIdentifier (" for" , {},
329
+ Trivia::spaces (1 ));
330
+ auto LocalName = SyntaxFactory::makeIdentifier (" integer" , {}, {});
331
+ auto Colon = SyntaxFactory::makeColonToken (Trivia::spaces (1 ),
332
+ Trivia::spaces (1 ));
333
+ auto Int = SyntaxFactory::makeTypeIdentifier (" Int" , {},
334
+ Trivia::spaces (0 ));
335
+ auto Ellipsis = SyntaxFactory::makeEllipsisToken ({},
336
+ Trivia::spaces (1 ));
337
+ auto Comma = SyntaxFactory::makeCommaToken ({}, {});
338
+
339
+ {
340
+ SmallString<48 > Scratch;
341
+ llvm::raw_svector_ostream OS (Scratch);
342
+ getCannedFunctionParameter ()
343
+ .withFirstName (ExternalName)
344
+ .withSecondName (LocalName)
345
+ .withColon (Colon)
346
+ .withType (Int)
347
+ .withEllipsis (Ellipsis)
348
+ .withDefaultArgument (llvm::None)
349
+ .withTrailingComma (Comma)
350
+ .print (OS);
351
+ ASSERT_EQ (OS.str ().str (), " for integer : Int... ," );
352
+ }
353
+ }
354
+
327
355
#pragma mark - parameter-list
328
356
329
357
TEST (DeclSyntaxTests, FunctionParameterListMakeAPIs) {
0 commit comments