File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
tests/HydraScript.IntegrationTests/ErrorPrograms Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1+ using HydraScript . Infrastructure ;
2+
3+ namespace HydraScript . IntegrationTests . ErrorPrograms ;
4+
5+ public class DefaultParameterTests ( TestHostFixture fixture ) : IClassFixture < TestHostFixture >
6+ {
7+ [ Fact ]
8+ public void DefaultParameter_PlacedBeforeNamed_HydraScriptError ( )
9+ {
10+ const string script = "function func(a = 1, b: boolean) { }" ;
11+ using var runner = fixture . GetRunner ( new TestHostFixture . Options ( InMemoryScript : script ) ) ;
12+ var code = runner . Invoke ( ) ;
13+ code . Should ( ) . Be ( Executor . ExitCodes . HydraScriptError ) ;
14+ fixture . LogMessages . Should ( )
15+ . Contain ( x => x . Contains ( "The argument b: boolean of function func is placed after default value argument" ) ) ;
16+ }
17+ }
You can’t perform that action at this time.
0 commit comments