Skip to content

Commit ff3c16d

Browse files
committed
#167 - fix cov 2
1 parent a5ab8ea commit ff3c16d

File tree

6 files changed

+20
-0
lines changed

6 files changed

+20
-0
lines changed

ExtendedJavaScriptSubset.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{04AB
7272
samples\overload.js = samples\overload.js
7373
samples\defaultparams.js = samples\defaultparams.js
7474
samples\nullable.js = samples\nullable.js
75+
samples\jump.js = samples\jump.js
7576
EndProjectSection
7677
EndProject
7778
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Src", "Src", "{FB8F6EE1-1942-46D6-954E-9A1647BBDF10}"

samples/jump.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
let i = 0
2+
while (i < 10) {
3+
if (i % 2 == 0)
4+
continue
5+
if (i == 7)
6+
break
7+
i = i + 1
8+
}
9+
>>> i

src/Domain/HydraScript.Domain.IR/Impl/Symbols/FunctionSymbol.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Diagnostics.CodeAnalysis;
12
using System.Text;
23
using HydraScript.Domain.IR.Impl.Symbols.Ids;
34

@@ -24,6 +25,7 @@ public class FunctionSymbol(
2425
public void DefineReturnType(Type returnType) =>
2526
_returnType = returnType;
2627

28+
[ExcludeFromCodeCoverage]
2729
public override string ToString() =>
2830
new StringBuilder($"function {Name}(")
2931
.AppendJoin(',', Parameters)

src/Domain/HydraScript.Domain.IR/Impl/Symbols/TypeSymbol.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Diagnostics.CodeAnalysis;
12
using HydraScript.Domain.IR.Impl.Symbols.Ids;
23

34
namespace HydraScript.Domain.IR.Impl.Symbols;
@@ -14,6 +15,7 @@ obj is TypeSymbol typeSymbol &&
1415
public override int GetHashCode() =>
1516
HashCode.Combine(Name, Type);
1617

18+
[ExcludeFromCodeCoverage]
1719
public override string ToString() =>
1820
$"type {Name} = {Type}";
1921
}

src/Domain/HydraScript.Domain.IR/Impl/Symbols/VariableSymbol.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Diagnostics.CodeAnalysis;
12
using HydraScript.Domain.IR.Impl.Symbols.Ids;
23

34
namespace HydraScript.Domain.IR.Impl.Symbols;
@@ -14,6 +15,7 @@ public class VariableSymbol(
1415

1516
public void Initialize() => Initialized = true;
1617

18+
[ExcludeFromCodeCoverage]
1719
public override string ToString() =>
1820
$"{(ReadOnly ? "const " : "")}{Name}: {Type}";
1921
}

tests/HydraScript.IntegrationTests/HydraScript.IntegrationTests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@
7272
<Link>Samples\gcd.js</Link>
7373
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
7474
</Content>
75+
<Content Include="..\..\samples\jump.js">
76+
<Link>Samples\jump.js</Link>
77+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
78+
</Content>
7579
<Content Include="..\..\samples\lcm.js">
7680
<Link>Samples\lcm.js</Link>
7781
<CopyToOutputDirectory>Always</CopyToOutputDirectory>

0 commit comments

Comments
 (0)