Skip to content

Commit 54b7982

Browse files
forth
1 parent 8c3b6f3 commit 54b7982

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

exercises/practice/forth/.meta/Generator.tpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ public class {{ testClass }}
99
{
1010
{{- if test.expected.error }}
1111
Assert.Throws<InvalidOperationException>(() => {{ testedClass }}.{{ test.testedMethod }}({{ test.input.instructions }}));
12+
{{ else if test.property == "evaluateBoth" }}
13+
Assert.Equal("{{test.expected[0] | array.join " "}}", {{ testedClass }}.Evaluate({{ test.input.instructionsFirst }}));
14+
Assert.Equal("{{test.expected[1] | array.join " "}}", {{ testedClass }}.Evaluate({{ test.input.instructionsSecond }}));
1215
{{ else }}
1316
Assert.Equal("{{test.expected | array.join " "}}", {{ testedClass }}.{{ test.testedMethod }}({{ test.input.instructions }}));
1417
{{ end -}}

exercises/practice/forth/ForthTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ public void User_defined_words_errors_if_executing_a_non_existent_word()
294294
[Fact(Skip = "Remove this Skip property to run this test")]
295295
public void User_defined_words_only_defines_locally()
296296
{
297-
Assert.Equal("[0] [2]", Forth.EvaluateBoth());
297+
Assert.Equal("0", Forth.Evaluate([": + - ;", "1 1 +"]));
298+
Assert.Equal("2", Forth.Evaluate(["1 1 +"]));
298299
}
299300

300301
[Fact(Skip = "Remove this Skip property to run this test")]

0 commit comments

Comments
 (0)