Example #1
0
        public void CompilerEmitterPushIntTest()
        {
            HvmEmitter emitter = new HvmEmitter(5);

            emitter.push(10);
            CollectionAssert.AreEqual(emitter.complete(), new byte[] { 13, 0, 0, 0, 10 });
        }
Example #2
0
        public void CompilerEmitterPushStringTest()
        {
            HvmEmitter emitter = new HvmEmitter(12); // 3 for opcode, and size
            string     test    = "this is 9";

            ;
            emitter.push(test);
            CollectionAssert.AreEqual(emitter.complete(), new byte[] { 77, 0, 9 }.Concat(test.ToCharArray().Select(a => (byte)a).ToArray()).ToArray());
        }