(t *testing.T)
| 1246 | } |
| 1247 | |
| 1248 | func TestPrintExprArrayItemWithKey(t *testing.T) { |
| 1249 | o := bytes.NewBufferString("") |
| 1250 | |
| 1251 | p := printer.NewPrettyPrinter(o, " ") |
| 1252 | p.Print(&expr.ArrayItem{ |
| 1253 | Key: &scalar.String{Value: "'Hello'"}, |
| 1254 | Val: &expr.Variable{VarName: &node.Identifier{Value: "world"}}, |
| 1255 | }) |
| 1256 | |
| 1257 | expected := `'Hello' => $world` |
| 1258 | actual := o.String() |
| 1259 | |
| 1260 | if expected != actual { |
| 1261 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 1262 | } |
| 1263 | } |
| 1264 | |
| 1265 | func TestPrintExprArrayItem(t *testing.T) { |
| 1266 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…