diff options
Diffstat (limited to 'internal/game/harness_test.go')
| -rw-r--r-- | internal/game/harness_test.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/internal/game/harness_test.go b/internal/game/harness_test.go index a368634..c80f437 100644 --- a/internal/game/harness_test.go +++ b/internal/game/harness_test.go @@ -147,13 +147,14 @@ func seedWorld(t *testing.T, dir string) { } // seedAccount writes an account file directly (bypassing the login menu). -func (h *harness) seedAccount(name, password string, admin bool) { +func (h *harness) seedAccount(name string) { + const password = "pw" t := h.t hash, err := player.HashPassword(password) if err != nil { t.Fatalf("hash: %v", err) } - acc := &player.Account{Name: name, PasswordHash: hash, Admin: admin} + acc := &player.Account{Name: name, PasswordHash: hash} if err := h.g.AccountStore.SaveAccount(acc); err != nil { t.Fatalf("seed account %s: %v", name, err) } @@ -239,11 +240,9 @@ func (h *harness) input(sess *net.Session, lines <-chan string) { } } -// goInput starts input goroutine(s) for a session, returning the send channel. -func (h *harness) goInput(sess *net.Session, workers int) chan<- string { +// goInput starts the input goroutine for a session, returning the send channel. +func (h *harness) goInput(sess *net.Session) chan<- string { lines := make(chan string, 64) - for i := 0; i < workers; i++ { - go h.input(sess, lines) - } + go h.input(sess, lines) return lines } |
