public void TestRuntimeError() { using (var invalid = new MemoryStream(Encoding.Unicode.GetBytes("[++]<<<"))) { var interpreter = new Brainfuck(invalid); interpreter.Evaluate(new BfContext()); } }
public void TestRot() { using (var fs = new FileStream("rot.bf", FileMode.Open, FileAccess.Read, FileShare.None)) { var interpreter = new Brainfuck(fs); interpreter.Evaluate(new BfContext()); Assert.AreEqual("n", actual: Writer.GetStringBuilder().ToString().Trim()); } }