Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8ba2779

Browse files
committed
a
1 parent 74d273e commit 8ba2779

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

SL.Test.Unit.Interpreter/tests/expresions/BinaryExpresionTests.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,17 @@ public async Task ShouldHandleAdd()
113113
.HasVariable("x", 6);
114114
}
115115

116+
[Test]
117+
public async Task ShouldHandleAddVariable()
118+
{
119+
var interpreter = await ExecuteProgram("var x = 3; var y = x + 3;");
120+
121+
ProgramAssert.AssertProgram(interpreter)
122+
.HasVariable("x", 3)
123+
.HasVariable("y", 6);
124+
}
125+
126+
116127
[Test]
117128
public async Task ShouldHandleMinus()
118129
{

SL.Test.Unit.Interpreter/tests/statements/ForeachBlockTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ public class ForeachBlockTests : InterpreterTestBase
66
public async Task ShouldHandleInfitieFor()
77
{
88
var interpreter= await ExecuteProgram("for(var i in range(2)) { print(i); }");
9-
10-
ProgramAssert.AssertProgram(interpreter)
11-
.HasConsoleOutputCount(3)
12-
.HasConsoleOutput("0",0)
13-
.HasConsoleOutput("1",1)
14-
.HasConsoleOutput("2",2);
9+
10+
ProgramAssert.AssertProgram(interpreter)
11+
.HasConsoleOutputCount(2)
12+
.HasConsoleOutput("0", 0)
13+
.HasConsoleOutput("1", 1);
14+
1515
}
1616
}

0 commit comments

Comments
 (0)