Skip to content

Commit 5a3689b

Browse files
committed
#187 - added test
1 parent 68cc1ab commit 5a3689b

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

tests/HydraScript.IntegrationTests/HydraScript.IntegrationTests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
<None Update="Samples\ceil.js">
3030
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
3131
</None>
32+
<None Update="Samples\counter.js">
33+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
34+
</None>
3235
<None Update="Samples\cycled.js">
3336
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
3437
</None>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
type Counter = {
2+
state:number;
3+
}
4+
5+
function next(counter: Counter, step = 1){
6+
counter.state = counter.state + step
7+
return counter.state
8+
}
9+
10+
function newCounter(start: number):Counter{
11+
return { state: start; }
12+
}
13+
14+
let counter = newCounter(4)
15+
>>>counter.next()
16+
>>>counter.next(2)

0 commit comments

Comments
 (0)