(t *testing.T)
| 17 | ) |
| 18 | |
| 19 | func TestShellExec(t *testing.T) { |
| 20 | src := "<? `cmd $a`;" |
| 21 | |
| 22 | expected := &node.Root{ |
| 23 | Position: &position.Position{ |
| 24 | StartLine: 1, |
| 25 | EndLine: 1, |
| 26 | StartPos: 3, |
| 27 | EndPos: 12, |
| 28 | }, |
| 29 | Stmts: []node.Node{ |
| 30 | &stmt.Expression{ |
| 31 | Position: &position.Position{ |
| 32 | StartLine: 1, |
| 33 | EndLine: 1, |
| 34 | StartPos: 3, |
| 35 | EndPos: 12, |
| 36 | }, |
| 37 | Expr: &expr.ShellExec{ |
| 38 | Position: &position.Position{ |
| 39 | StartLine: 1, |
| 40 | EndLine: 1, |
| 41 | StartPos: 3, |
| 42 | EndPos: 11, |
| 43 | }, |
| 44 | Parts: []node.Node{ |
| 45 | &scalar.EncapsedStringPart{ |
| 46 | Position: &position.Position{ |
| 47 | StartLine: 1, |
| 48 | EndLine: 1, |
| 49 | StartPos: 4, |
| 50 | EndPos: 8, |
| 51 | }, |
| 52 | Value: "cmd ", |
| 53 | }, |
| 54 | &expr.Variable{ |
| 55 | Position: &position.Position{ |
| 56 | StartLine: 1, |
| 57 | EndLine: 1, |
| 58 | StartPos: 8, |
| 59 | EndPos: 10, |
| 60 | }, |
| 61 | VarName: &node.Identifier{ |
| 62 | Position: &position.Position{ |
| 63 | StartLine: 1, |
| 64 | EndLine: 1, |
| 65 | StartPos: 8, |
| 66 | EndPos: 10, |
| 67 | }, |
| 68 | Value: "a", |
| 69 | }, |
| 70 | }, |
| 71 | }, |
| 72 | }, |
| 73 | }, |
| 74 | }, |
| 75 | } |
| 76 |
nothing calls this directly
no test coverage detected
searching dependent graphs…