public void Executor_NestedFunctions_One_Success() { var tree = new ParseTree(); var addNode = new FunctionNode("add"); addNode.AddChild(GetRandNode()); addNode.AddChild(new ValueNode("3", Token.Int)); tree.Root.AddChild(addNode); var result = _executor.Execute(tree); Assert.IsTrue(result.Success, "Should be able to process nested functions"); }
private FunctionNode GetRandNode() { var funcNode = new FunctionNode("rand"); funcNode.AddChild(new ValueNode("5", Token.Int)); return funcNode; }