MCPcopy
hub / github.com/gdamore/tcell / WriteF

Function WriteF

vt/tests/util.go:33–46  ·  view source on GitHub ↗

WriteF writes the string, and ensures it is fully flushed before returning.

(t *testing.T, term MockTerm, str string, args ...any)

Source from the content-addressed store, hash-verified

31// WriteF writes the string, and ensures it is fully flushed
32// before returning.
33func WriteF(t *testing.T, term MockTerm, str string, args ...any) {
34 t.Helper()
35 b := fmt.Appendf(nil, str, args...)
36 for len(b) != 0 {
37 if n, err := term.Write(b); err != nil {
38 t.Fatalf("Failed to write: %v", err)
39 } else {
40 b = b[n:]
41 }
42 }
43 if err := term.Drain(); err != nil {
44 t.Fatalf("Failed to flush: %v", err)
45 }
46}
47
48// ReadF reads content from the term and returns it as a string.
49func ReadF(t *testing.T, term MockTerm) string {

Callers 15

TestKeyRepeatDisabledFunction · 0.85
TestKeyWin32Function · 0.85
TestKeyWin32NoRepeatFunction · 0.85
TestKeyWin32RepeatFunction · 0.85
TestKeyWin32NoRepeatModeFunction · 0.85
TestMouse1006Function · 0.85
TestMouseX10Function · 0.85
TestMouse1000Function · 0.85
TestDECSTBMv1Function · 0.85
TestDECSTBMv2Function · 0.85
TestDECSTBMv3Function · 0.85
TestDECSTBMv4Function · 0.85

Calls 2

DrainMethod · 0.65
WriteMethod · 0.45

Tested by 15

TestKeyRepeatDisabledFunction · 0.68
TestKeyWin32Function · 0.68
TestKeyWin32NoRepeatFunction · 0.68
TestKeyWin32RepeatFunction · 0.68
TestKeyWin32NoRepeatModeFunction · 0.68
TestMouse1006Function · 0.68
TestMouseX10Function · 0.68
TestMouse1000Function · 0.68
TestDECSTBMv1Function · 0.68
TestDECSTBMv2Function · 0.68
TestDECSTBMv3Function · 0.68
TestDECSTBMv4Function · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…