public void CompileBlock()
{
Block block = this.compiler.CompileBlock("nil ifFalse: [self halt]");
Assert.IsNotNull(block);
Assert.AreEqual(1, block.NoConstants);
Assert.AreEqual(0, block.NoLocals);
Assert.IsNotNull(block.ByteCodes);
Assert.AreEqual(11, block.ByteCodes.Length);
Assert.AreEqual(0, block.Arity);
object constant = block.GetConstant(0);
Assert.IsNotNull(constant);
Assert.IsInstanceOfType(constant, typeof(Block));
var newblock = (Block)constant;
Assert.AreEqual(0, newblock.Arity);
Assert.AreEqual(0, newblock.NoLocals);
Assert.IsNotNull(newblock.ByteCodes);
Assert.AreEqual(4, newblock.ByteCodes.Length);
BlockDecompiler decompiler = new BlockDecompiler(block);
var result = decompiler.Decompile();
Assert.IsNotNull(result);
Assert.AreEqual("GetNil", result[0]);
Assert.AreEqual("JumpIfFalse 8", result[1]);
Assert.AreEqual("GetNil", result[2]);
Assert.AreEqual("Jump 11", result[3]);
Assert.AreEqual("GetBlock { GetSelf; Send halt 0 }", result[4]);
}