MCPcopy
hub / github.com/git-lfs/git-lfs / TestLoggerLogsTasks

Function TestLoggerLogsTasks

tasklog/log_test.go:24–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22func (e UnthrottledChanTask) Throttled() bool { return false }
23
24func TestLoggerLogsTasks(t *testing.T) {
25 var buf bytes.Buffer
26
27 task := make(chan *Update)
28 go func() {
29 task <- &Update{"first", time.Now(), false}
30 task <- &Update{"second", time.Now(), false}
31 close(task)
32 }()
33
34 l := NewLogger(&buf, ForceProgress(true))
35 l.throttle = 0
36 l.widthFn = func() int { return 0 }
37 l.Enqueue(ChanTask(task))
38 l.Close()
39
40 assert.Equal(t, "first\rsecond\rsecond, done.\n", buf.String())
41}
42
43func TestLoggerLogsSuppressesProgress(t *testing.T) {
44 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 7

EnqueueMethod · 0.95
CloseMethod · 0.95
NewLoggerFunction · 0.85
ForceProgressFunction · 0.85
ChanTaskTypeAlias · 0.85
StringMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected