Skip to content
Myr

Fix typo in code

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 1b55999 · Browse files · 3 files+7 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+7 added−7 removed

  • other:+7 added−7 removed

3 files+7 added−7 removed

modified:src/util/eventbox.go+2 added-2 removed
51 unmodified lines
52 delete(*events, event)53 }54}5556// Peak peaks at the event box if the given event is set57func (b *EventBox) Peak(event EventType) bool {56// Peek peeks at the event box if the given event is set57func (b *EventBox) Peek(event EventType) bool {58 b.cond.L.Lock()59 defer b.cond.L.Unlock()60 _, ok := b.events[event]61 return ok
34 unmodified lines
modified:src/matcher.go+1 added-1 removed
181 unmodified lines
182 if count == numChunks {183 break184 }185186 if !empty && m.reqBox.Peak(reqReset) {186 if !empty && m.reqBox.Peek(reqReset) {187 return nil, wait()188 }189190 if time.Now().Sub(startedAt) > progressMinDuration {
24 unmodified lines
modified:src/reader_test.go+4 added-4 removed
12 unmodified lines
13 pusher: func(s string) { strs = append(strs, s) },14 eventBox: eb}1516 // Check EventBox17 if eb.Peak(EvtReadNew) {17 if eb.Peek(EvtReadNew) {18 t.Error("EvtReadNew should not be set yet")19 }2021 // Normal command
2 unmodified lines
24 t.Errorf("%s", strs)25 }2627 // Check EventBox again28 if !eb.Peak(EvtReadNew) {28 if !eb.Peek(EvtReadNew) {29 t.Error("EvtReadNew should be set yet")30 }3132 // Wait should return immediately
4 unmodified lines
37 events.Clear()38 })3940 // EventBox is cleared41 if eb.Peak(EvtReadNew) {41 if eb.Peek(EvtReadNew) {42 t.Error("EvtReadNew should not be set yet")43 }4445 // Failing command
3 unmodified lines
49 t.Errorf("%s", strs)50 }5152 // Check EventBox again53 if eb.Peak(EvtReadNew) {53 if eb.Peek(EvtReadNew) {54 t.Error("Command failed. EvtReadNew should be set")55 }56}