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

Function TestPrintBinaryMod

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

Source from the content-addressed store, hash-verified

926}
927
928func TestPrintBinaryMod(t *testing.T) {
929 o := bytes.NewBufferString("")
930
931 p := printer.NewPrettyPrinter(o, " ")
932 p.Print(&binary.Mod{
933 Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
934 Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
935 })
936
937 expected := `$a % $b`
938 actual := o.String()
939
940 if expected != actual {
941 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
942 }
943}
944
945func TestPrintBinaryMul(t *testing.T) {
946 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…