mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
refactor channel registration
This commit is contained in:
parent
29db70fa7b
commit
63029e2ff5
21 changed files with 420 additions and 226 deletions
|
|
@ -23,7 +23,8 @@ func makeTestWhowas(nick string) WhoWas {
|
|||
|
||||
func TestWhoWas(t *testing.T) {
|
||||
var results []WhoWas
|
||||
wwl := NewWhoWasList(3)
|
||||
var wwl WhoWasList
|
||||
wwl.Initialize(3)
|
||||
// test Find on empty list
|
||||
results = wwl.Find("nobody", 10)
|
||||
if len(results) != 0 {
|
||||
|
|
@ -88,7 +89,8 @@ func TestWhoWas(t *testing.T) {
|
|||
|
||||
func TestEmptyWhoWas(t *testing.T) {
|
||||
// stupid edge case; setting an empty whowas buffer should not panic
|
||||
wwl := NewWhoWasList(0)
|
||||
var wwl WhoWasList
|
||||
wwl.Initialize(0)
|
||||
results := wwl.Find("slingamn", 10)
|
||||
if len(results) != 0 {
|
||||
t.Fatalf("incorrect whowas results: %v", results)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue