Add more unit test

This commit is contained in:
Stone_Red
2024-08-08 23:57:55 +02:00
parent 9a6f1d7806
commit 1df0d34841
2 changed files with 43 additions and 6 deletions
@@ -0,0 +1,37 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;
namespace YesNt.Interpreter.Tests;
[TestClass]
public class CodeFlowTests
{
[TestMethod]
public void FunctionTest()
{
List<string> lines =
[
"cal yes",
"fnc yes",
"!<result = 1",
"ret",
">result"
];
YesNtAssert.IsLastLineEqual(lines, "1");
}
[TestMethod]
public void LabelsTest()
{
List<string> lines =
[
"<result = 1",
"jmp yes",
"<result = 0",
"lbl yes",
">result"
];
YesNtAssert.IsLastLineEqual(lines, "1");
}
}