(t *testing.T)
| 20 | ) |
| 21 | |
| 22 | func TestFunctionCall(t *testing.T) { |
| 23 | src := `<? foo();` |
| 24 | |
| 25 | expected := &node.Root{ |
| 26 | Position: &position.Position{ |
| 27 | StartLine: 1, |
| 28 | EndLine: 1, |
| 29 | StartPos: 3, |
| 30 | EndPos: 9, |
| 31 | }, |
| 32 | Stmts: []node.Node{ |
| 33 | &stmt.Expression{ |
| 34 | Position: &position.Position{ |
| 35 | StartLine: 1, |
| 36 | EndLine: 1, |
| 37 | StartPos: 3, |
| 38 | EndPos: 9, |
| 39 | }, |
| 40 | Expr: &expr.FunctionCall{ |
| 41 | Position: &position.Position{ |
| 42 | StartLine: 1, |
| 43 | EndLine: 1, |
| 44 | StartPos: 3, |
| 45 | EndPos: 8, |
| 46 | }, |
| 47 | Function: &name.Name{ |
| 48 | Position: &position.Position{ |
| 49 | StartLine: 1, |
| 50 | EndLine: 1, |
| 51 | StartPos: 3, |
| 52 | EndPos: 6, |
| 53 | }, |
| 54 | Parts: []node.Node{ |
| 55 | &name.NamePart{ |
| 56 | Position: &position.Position{ |
| 57 | StartLine: 1, |
| 58 | EndLine: 1, |
| 59 | StartPos: 3, |
| 60 | EndPos: 6, |
| 61 | }, |
| 62 | Value: "foo", |
| 63 | }, |
| 64 | }, |
| 65 | }, |
| 66 | ArgumentList: &node.ArgumentList{ |
| 67 | Position: &position.Position{ |
| 68 | StartLine: 1, |
| 69 | EndLine: 1, |
| 70 | StartPos: 6, |
| 71 | EndPos: 8, |
| 72 | }, |
| 73 | }, |
| 74 | }, |
| 75 | }, |
| 76 | }, |
| 77 | } |
| 78 | |
| 79 | php7parser := php7.NewParser([]byte(src), "7.4") |
nothing calls this directly
no test coverage detected
searching dependent graphs…