test(signserver): increase test coverage from 1.5% to 45.2%

Add comprehensive tests for signserver package using sqlmock for
database function testing:

- Server lifecycle tests (Start, Shutdown, acceptClients)
- Connection handling tests (handleConnection, multiple connections)
- Database function tests (getCharactersForUser, getLastCID,
  getUserRights, checkToken, registerToken, deleteCharacter,
  newUserChara, registerDBAccount, getReturnExpiry,
  getFriendsForCharacters, getGuildmatesForCharacters)
- Session struct and packet handling tests

All tests pass with race detection enabled.
This commit is contained in:
Houmgaor
2026-02-03 00:19:48 +01:00
parent ae2928ad57
commit 9c5cc559c7
5 changed files with 1434 additions and 0 deletions

1
go.mod
View File

@@ -17,6 +17,7 @@ require (
)
require (
github.com/DATA-DOG/go-sqlmock v1.5.2 // indirect
github.com/felixge/httpsnoop v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/gorilla/websocket v1.4.2 // indirect