test: improve test coverage from 11% to 20%

Add comprehensive tests across multiple packages:

- mhfpacket: Add tests for 300+ packet opcodes, system packets,
  MHF packets, and detailed parsing tests (6.4% -> 38.8%)
- timeserver: Add tests for all time functions (0% -> 97.4%)
- deltacomp: Add edge case tests for compression functions
- entranceserver: Add server creation tests
- binpacket: Add mail notify panic test
- config: Add Mode.String() tests
- signserver: Expand server tests
This commit is contained in:
Houmgaor
2026-02-02 11:02:52 +01:00
parent 21a66841ab
commit dad6a23bba
10 changed files with 3040 additions and 0 deletions

View File

@@ -475,6 +475,37 @@ func TestChannelStruct(t *testing.T) {
}
}
func TestModeString(t *testing.T) {
tests := []struct {
mode Mode
want string
}{
{S1, "S1.0"},
{S15, "S1.5"},
{S2, "S2.0"},
{S6, "S6.0"},
{F1, "FW.1"},
{F5, "FW.5"},
{G1, "G1"},
{G10, "G10"},
{Z1, "Z1"},
{Z2, "Z2"},
{ZZ, "ZZ"},
{Mode(0), "Unknown"},
{Mode(-1), "Unknown"},
{Mode(100), "Unknown"},
}
for _, tt := range tests {
t.Run(tt.want, func(t *testing.T) {
got := tt.mode.String()
if got != tt.want {
t.Errorf("Mode(%d).String() = %s, want %s", tt.mode, got, tt.want)
}
})
}
}
func TestConfigCompleteStructure(t *testing.T) {
// Test building a complete config structure
cfg := &Config{