Skip to content

Commit 98d6ee2

Browse files
committed
#167 - error test
1 parent eec48c5 commit 98d6ee2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
}

0 commit comments

Comments
 (0)