MCPcopy
hub / github.com/pterm/pterm / TestAreaPrinter_GetContent

Function TestAreaPrinter_GetContent

area_printer_test.go:77–91  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

75}
76
77func TestAreaPrinter_GetContent(t *testing.T) {
78 originalStdout := os.Stdout
79 os.Stdout = os.NewFile(0, os.DevNull) // Set os.Stdout to DevNull to hide output from cursor.Area
80
81 a, _ := pterm.DefaultArea.Start()
82
83 for _, printable := range printables {
84 a.Update(printable)
85 testza.AssertEqual(t, a.GetContent(), pterm.Sprint(printable))
86 }
87
88 a.Stop()
89
90 os.Stdout = originalStdout // Restore original os.Stdout
91}
92
93func TestAreaPrinter_WithRemoveWhenDone(t *testing.T) {
94 originalStdout := os.Stdout

Callers

nothing calls this directly

Calls 5

SprintFunction · 0.92
UpdateMethod · 0.80
GetContentMethod · 0.80
StartMethod · 0.45
StopMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…