@@ -273,6 +273,35 @@ public Task TestTemplateWithCircleDependencyInMacros()
273273 VerificationEngine engine = new VerificationEngine ( _log ) ;
274274 return engine . Execute ( options ) ;
275275 }
276+
277+ [ Fact ]
278+ public Task TestSelectionForMultiChoicesWhenThereAreMultiplePartialMatchesAndOnePreciseMatch ( )
279+ {
280+ string templateLocation = GetTestTemplateLocation ( "TemplateWithMultipleChoicesAndPartialMatches" ) ;
281+ var templateParams = new Dictionary < string , string ? > ( )
282+ {
283+ // There are multiple choices for the parameter that overlap: "aab", "aac", "aa".
284+ // We want to ensure that "aa" can be selected, because it is a precise match,
285+ // even if there are more than one choices that start with "aa", and even if "aa",
286+ // is not listed first in the list of choices.
287+ { "tests" , "aa" }
288+ } ;
289+ string workingDir = TestUtils . CreateTemporaryFolder ( ) ;
290+
291+ TemplateVerifierOptions options =
292+ new TemplateVerifierOptions ( templateName : "TestAssets.TemplateWithMultipleChoicesAndPartialMatches" )
293+ {
294+ TemplatePath = templateLocation ,
295+ OutputDirectory = workingDir ,
296+ DoNotAppendTemplateArgsToScenarioName = true ,
297+ DoNotPrependTemplateNameToScenarioName = true ,
298+ SnapshotsDirectory = "Approvals"
299+ }
300+ . WithInstantiationThroughTemplateCreatorApi ( templateParams ) ;
301+
302+ VerificationEngine engine = new VerificationEngine ( _log ) ;
303+ return engine . Execute ( options ) ;
304+ }
276305 }
277306}
278307
0 commit comments