MCPcopy Create free account
hub / github.com/z7zmey/php-parser / TestPow

Function TestPow

node/expr/binary/t_binary_op_test.go:1587–1660  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1585}
1586
1587func TestPow(t *testing.T) {
1588 src := `<? $a ** $b;`
1589
1590 expected := &node.Root{
1591 Position: &position.Position{
1592 StartLine: 1,
1593 EndLine: 1,
1594 StartPos: 3,
1595 EndPos: 12,
1596 },
1597 Stmts: []node.Node{
1598 &stmt.Expression{
1599 Position: &position.Position{
1600 StartLine: 1,
1601 EndLine: 1,
1602 StartPos: 3,
1603 EndPos: 12,
1604 },
1605 Expr: &binary.Pow{
1606 Position: &position.Position{
1607 StartLine: 1,
1608 EndLine: 1,
1609 StartPos: 3,
1610 EndPos: 11,
1611 },
1612 Left: &expr.Variable{
1613 Position: &position.Position{
1614 StartLine: 1,
1615 EndLine: 1,
1616 StartPos: 3,
1617 EndPos: 5,
1618 },
1619 VarName: &node.Identifier{
1620 Position: &position.Position{
1621 StartLine: 1,
1622 EndLine: 1,
1623 StartPos: 3,
1624 EndPos: 5,
1625 },
1626 Value: "a",
1627 },
1628 },
1629 Right: &expr.Variable{
1630 Position: &position.Position{
1631 StartLine: 1,
1632 EndLine: 1,
1633 StartPos: 9,
1634 EndPos: 11,
1635 },
1636 VarName: &node.Identifier{
1637 Position: &position.Position{
1638 StartLine: 1,
1639 EndLine: 1,
1640 StartPos: 9,
1641 EndPos: 11,
1642 },
1643 Value: "b",
1644 },

Callers

nothing calls this directly

Calls 4

ParseMethod · 0.95
GetRootNodeMethod · 0.95
NewParserFunction · 0.92
NewParserFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…