MCPcopy
hub / github.com/pterm/pterm / testSprintfContains

Function testSprintfContains

utils_test.go:137–148  ·  view source on GitHub ↗

testSprintfContains can be used to test Sprintf methods.

(t *testing.T, logic func(format string, a any) string)

Source from the content-addressed store, hash-verified

135
136// testSprintfContains can be used to test Sprintf methods.
137func testSprintfContains(t *testing.T, logic func(format string, a any) string) {
138 for _, printable := range printables {
139 t.Run(fmt.Sprint(printable), func(t *testing.T) {
140 testza.AssertContains(t, logic("Hello, %v!", printable), fmt.Sprintf("Hello, %v!", printable))
141 })
142 pterm.DisableStyling()
143 t.Run(fmt.Sprint(printable), func(t *testing.T) {
144 testza.AssertContains(t, logic("Hello, %v!", printable), fmt.Sprintf("Hello, %v!", printable))
145 })
146 pterm.EnableStyling()
147 }
148}
149
150// testSprintflnContains can be used to test Sprintfln methods.
151func testSprintflnContains(t *testing.T, logic func(format string, a any) string) {

Calls 4

DisableStylingFunction · 0.92
EnableStylingFunction · 0.92
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…