public void PutYVariable() { AbstractMachineState state = SetupMachine(); state.E = new EnvironmentFrame(null, null, 10); PutVariableInstruction i = new PutVariableInstruction(); object[] args = { "Y0", "X0" }; i.Process(args); i.Execute(state); Assert.AreEqual("put_variable", i.Name()); Assert.AreEqual(2, i.NumberOfArguments()); Assert.IsTrue(state.E["Y0"].IsReference); Assert.AreSame(state.E["Y0"].Dereference(), ((AbstractTerm)state["X0"]).Dereference()); }
public void PutXVariable() { AbstractMachineState state = SetupMachine(); PutVariableInstruction i = new PutVariableInstruction(); object[] args = { "X0", "X1" }; i.Process(args); i.Execute(state); Assert.AreSame(state["H"], ((AbstractTerm)state["X0"]).Dereference()); Assert.AreSame(state["H"], ((AbstractTerm)state["X1"]).Dereference()); Assert.AreEqual("put_variable", i.Name()); Assert.AreEqual(2, i.NumberOfArguments()); }