示例#1
0
 public void TestRuntimeError()
 {
     using (var invalid = new MemoryStream(Encoding.Unicode.GetBytes("[++]<<<")))
     {
         var interpreter = new Brainfuck(invalid);
         interpreter.Evaluate(new BfContext());
     }
 }
示例#2
0
 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());
     }
 }