mirror of
https://github.com/Stone-Red-Code/YesNt-Interpreter.git
synced 2026-09-08 23:43:18 +02:00
Reformatting and reimperilment escape codes
This commit is contained in:
@@ -38,7 +38,6 @@ public class CodeFlowTests
|
||||
[TestMethod]
|
||||
public void CalculationsTest()
|
||||
{
|
||||
Assert.Inconclusive();
|
||||
YesNtAssert.IsLineEqual("10 * 10 !calc", 20.ToString());
|
||||
YesNtAssert.IsLineEqual("10 * 10 !calc", 100.ToString());
|
||||
}
|
||||
}
|
||||
@@ -60,4 +60,26 @@ internal static class YesNtAssert
|
||||
|
||||
Assert.AreEqual(expected, debugEventArgs.CurrentLine);
|
||||
}
|
||||
|
||||
public static void IsLineNotEqual(string line, string expected, int timeout = 1000)
|
||||
{
|
||||
AutoResetEvent onDone = new AutoResetEvent(false);
|
||||
List<string> lines = new List<string>()
|
||||
{
|
||||
line
|
||||
};
|
||||
|
||||
DebugEventArgs debugEventArgs = new DebugEventArgs();
|
||||
yesNtInterpreter.OnLineExecuted += (er) =>
|
||||
{
|
||||
debugEventArgs = er ?? debugEventArgs;
|
||||
_ = onDone.Set();
|
||||
};
|
||||
|
||||
yesNtInterpreter.Execute(lines, true);
|
||||
|
||||
_ = onDone.WaitOne(TimeSpan.FromMilliseconds(timeout));
|
||||
|
||||
Assert.AreNotEqual(expected, debugEventArgs.CurrentLine);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user