Documentation
¶
Index ¶
- Constants
- func Indent(input string) string
- type TNode
- func CreateTree(t *testing.T, partialNodes []xutils.PathType) *TNode
- func NewTContainer(root *TNode, startPath xutils.PathType, module string, name string) *TNode
- func NewTEmptyLeaf(root *TNode, startPath xutils.PathType, module string, name string) *TNode
- func NewTEphemeralContainer(root *TNode, startPath xutils.PathType, module string, name string) *TNode
- func NewTLeaf(root *TNode, startPath xutils.PathType, module string, name string, ...) *TNode
- func NewTLeafList(root *TNode, startPath xutils.PathType, module string, name string, ...) *TNode
- func NewTLeafOrLeafList(root *TNode, startPath xutils.PathType, module string, name string, ...) *TNode
- func NewTListEntry(root *TNode, startPath xutils.PathType, module string, name string, ...) *TNode
- func (t1 *TNode) EqualTo(n2 xutils.XpathNode) error
- func (testnode *TNode) FindFirstNode(path xutils.PathType) *TNode
- func (testnode *TNode) String() string
- func (testnode *TNode) XChildren(filter xutils.XFilter, sortSpec xutils.SortSpec) []xutils.XpathNode
- func (testnode *TNode) XIsEphemeral() bool
- func (testnode *TNode) XIsLeaf() bool
- func (testnode *TNode) XIsLeafList() bool
- func (testnode *TNode) XIsNonPresCont() bool
- func (testnode *TNode) XListKeyMatches(key xml.Name, val string) bool
- func (testnode *TNode) XListKeys() []xutils.NodeRefKey
- func (testnode *TNode) XName() string
- func (testnode *TNode) XParent() xutils.XpathNode
- func (testnode *TNode) XPath() xutils.PathType
- func (testnode *TNode) XRoot() xutils.XpathNode
- func (testnode *TNode) XValue() string
- type TNodeSet
Constants ¶
const ( Brk = "----\n" CrtNS = "CreateNodeSet:\t\t" FiltNS = "FilterNodeSet:\t\t" IgnPfxs = "\n\nIf we ignore prefixes, we now get:\n\n" InstELP = "Instr:\tevalLocPath" InstELPPS = "Instr:\tevalLocPath(PredStart)" InstESM = "Instr:\tevalSubMachine" InstLrefEq = "Instr:\tlrefEquals" InstLrefPE = "Instr:\tlrefPredEnd" InstLrefPS = "Instr:\tlrefPredStart" InstNtPsh_B = "Instr:\tnameTestPush\t{" InstNumPsh = "Instr:\tnumpush\t\t" InstPoPsh = "Instr:\tpathOperPush\t" InstStore = "Instr:\tstore" ModName = "xpathNodeTestModule" PredMatch = "Pred:\tMATCH\n" PredNoMatch = "Pred:\tNo Match\n" Run = "Run\t" Stack = "Stack:\t" StNS = "Stack:\tNODESET\t\t" StNT_B = "Stack:\tNAMETEST\t{" StNum = "Stack:\tNUMBER\t\t" StPO = "Stack:\tPATHOPER\t" Tab3 = "\t\t\t" T_ApNS = "\tApply: NODESET\t\t" T_ApNT_B = "\tApply: NAMETEST\t{" T_ApPO = "\tApply: PATHOPER\t" T_PO_T = "\tPATHOPER\t" T_NS_T = "\tNODESET\t\t" T_NT_TB = "\tNAMETEST\t{" T_UNS = "Using stacked nodeset:\n" ValPath = "ValidatePath:\t\tCtx: " )
This file contains strings used in printing out the operation of a machine. The definitions are separate to those in production code so if the format changes, we are made aware of it. Otherwise it is possible that 2 strings could get swapped in production code and we would not spot it in test code.
Extracting these strings has the benefit that they appear in black in emacs versus the brown for 'text in quotes' so you can see the details that change in each line more clearly. More to the point, all the generic stuff can now be easily changed in a single place.
In some cases, leading or trailing symbols are explicitly stated so it is easier to construct the expOut strings.
T = Tab B = Brace ('{')
const ( Container nodeType = iota ListEntry LeafList Leaf )
const (
TestModule = "xpathNodeTestModule"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TNode ¶
type TNode struct {
// contains filtered or unexported fields
}
func CreateTree ¶
Takes a set of partially defined test nodes and stitches them together into a tree. Each element of a partialNode can be of different types, and is specified in partial nodes using the following syntax:
- Container : string - EphemeralCont : string$ - List : string/key+value - LeafList : string@value - Leaf : string+value - EmptyLeaf : string%
func NewTContainer ¶
func NewTEmptyLeaf ¶
func NewTEphemeralContainer ¶
func NewTLeafList ¶
func NewTLeafOrLeafList ¶
func NewTListEntry ¶
func (*TNode) EqualTo ¶
We don't fully construct our expected testnodes into a tree, so we can't use the standard equalTo() function for XpathNodes. Instead we do it in rather long-winded fashion.
func (*TNode) FindFirstNode ¶
Find first node that matches (ie for list entries, we're only interested in finding an entry with the path, not a specific one. Start at root
func (*TNode) XIsEphemeral ¶
func (*TNode) XIsLeafList ¶
func (*TNode) XIsNonPresCont ¶
func (*TNode) XListKeyMatches ¶
func (*TNode) XListKeys ¶
func (testnode *TNode) XListKeys() []xutils.NodeRefKey