File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
compiler/test/dotty/tools/dotc Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -166,18 +166,23 @@ class SettingsTests {
166166 )
167167 assertEquals(expectedErrors, summary.errors)
168168 }
169+ end validateChoices
169170
170171 @ Test def `Allow IntSetting's to be set with a colon` : Unit =
171172 object Settings extends SettingGroup :
172173 val foo = IntSetting (" -foo" , " foo" , 80 )
173174 import Settings ._
174175
175- val args = List (" -foo:100" )
176- val summary = processArguments(args, processAll = true )
177- assertTrue(s " Setting args errors: \n ${summary.errors.take(5 ).mkString(" \n " )}" , summary.errors.isEmpty)
178- withProcessedArgs(summary) {
179- assertEquals(100 , foo.value)
176+ def check (args : List [String ]) = {
177+ val summary = processArguments(args, processAll = true )
178+ assertTrue(s " Setting args errors: \n ${summary.errors.take(5 ).mkString(" \n " )}" , summary.errors.isEmpty)
179+ withProcessedArgs(summary) {
180+ assertEquals(100 , foo.value)
181+ }
180182 }
183+ check(List (" -foo:100" ))
184+ check(List (" -foo" , " 100" ))
185+ assertThrows[AssertionError ](_.getMessage.contains(" missing argument for option -foo" ))(check(List (" -foo" )))
181186
182187 private def withProcessedArgs (summary : ArgsSummary )(f : SettingsState ?=> Unit ) = f(using summary.sstate)
183188
You can’t perform that action at this time.
0 commit comments