Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
while-loop committed Jun 23, 2023
1 parent fc3bff8 commit f555358
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ func TestState_getHistory(t *testing.T) {
history: []string{"food", "foot", "tool"},
want: []string{"food", "foot", "tool"},
},
{
name: "empty string with pattern mode matches whole history",
line: "",
historyMode: HistoryModePattern,
history: []string{"food", "foot", "tool"},
want: []string{"food", "foot", "tool"},
},
{
name: "empty string with prefix mode matches whole history",
line: "",
historyMode: HistoryModePattern,
history: []string{"food", "foot", "tool"},
want: []string{"food", "foot", "tool"},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit f555358

Please sign in to comment.