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

Function TestPrintUnaryPlus

printer/pretty_printer_test.go:2015–2029  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2013}
2014
2015func TestPrintUnaryPlus(t *testing.T) {
2016 o := bytes.NewBufferString("")
2017
2018 p := printer.NewPrettyPrinter(o, " ")
2019 p.Print(&expr.UnaryPlus{
2020 Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}},
2021 })
2022
2023 expected := `+$var`
2024 actual := o.String()
2025
2026 if expected != actual {
2027 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2028 }
2029}
2030
2031func TestPrintVariable(t *testing.T) {
2032 o := bytes.NewBufferString("")

Callers

nothing calls this directly

Calls 3

PrintMethod · 0.95
NewPrettyPrinterFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…