MCPcopy
hub / github.com/pterm/pterm / TestCenterPrinterPrintMethodsCenterSeparately

Function TestCenterPrinterPrintMethodsCenterSeparately

center_printer_test.go:102–140  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

100}
101
102func TestCenterPrinterPrintMethodsCenterSeparately(t *testing.T) {
103 p := pterm.DefaultCenter.WithCenterEachLineSeparately()
104
105 t.Run("Print", func(t *testing.T) {
106 testPrintContains(t, func(w io.Writer, a any) {
107 p.Print(a)
108 })
109 })
110
111 t.Run("Printf", func(t *testing.T) {
112 testPrintfContains(t, func(w io.Writer, format string, a any) {
113 p.Printf(format, a)
114 })
115 })
116
117 t.Run("Println", func(t *testing.T) {
118 testPrintlnContains(t, func(w io.Writer, a any) {
119 p.Println(a)
120 })
121 })
122
123 t.Run("Sprint", func(t *testing.T) {
124 testSprintContains(t, func(a any) string {
125 return p.Sprint(a)
126 })
127 })
128
129 t.Run("Sprintf", func(t *testing.T) {
130 testSprintfContains(t, func(format string, a any) string {
131 return p.Sprintf(format, a)
132 })
133 })
134
135 t.Run("Sprintln", func(t *testing.T) {
136 testSprintlnContains(t, func(a any) string {
137 return p.Sprintln(a)
138 })
139 })
140}
141
142func TestCenterPrinter_SprintLineLongerThanTerminal(t *testing.T) {
143 p := pterm.DefaultCenter

Callers

nothing calls this directly

Calls 13

testPrintContainsFunction · 0.85
testPrintfContainsFunction · 0.85
testPrintlnContainsFunction · 0.85
testSprintContainsFunction · 0.85
testSprintfContainsFunction · 0.85
testSprintlnContainsFunction · 0.85
PrintMethod · 0.65
PrintfMethod · 0.65
PrintlnMethod · 0.65
SprintMethod · 0.65
SprintfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…