public void RetryMeElse() { AbstractMachineState state = SetupMachine(); RetryMeElseInstruction i = new RetryMeElseInstruction(); AMProgram program = (AMProgram)state.Program; AMTrail trail = (AMTrail)state.Trail; Choicepoint b = new Choicepoint(); b.CE = new EnvironmentFrame(); b.B = new Choicepoint(); b.CP = new ProgramNode(); b.TR = 1; b.NextClause = new ProgramClause(); state.B = b; program.AddLabel("foobar/2", new ProgramClause()); object[] args = { "foobar/2" }; i.Process(args); i.Execute(state); Assert.AreEqual("retry_me_else", i.Name()); Assert.AreEqual(1, i.NumberOfArguments()); Assert.AreSame(state.E, b.CE); Assert.AreEqual(b.TR, trail.TR); Assert.AreEqual(state.B.NextClause, program["foobar/2"]); }