MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / TestRoundCount

Function TestRoundCount

internal/util/util_test.go:59–79  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

57}
58
59func TestRoundCount(t *testing.T) {
60 // Reset roundCount for test isolation
61 SetRoundCount(1314000)
62
63 if rc := GetRoundCount(); rc != 1314000 {
64 t.Fatalf("Expected roundCount to be 1314000, got %d", rc)
65 }
66
67 SetRoundCount(2000)
68 if rc := GetRoundCount(); rc != 2000 {
69 t.Fatalf("Expected roundCount to be 2000, got %d", rc)
70 }
71
72 newRC := IncrementRoundCount()
73 if newRC != 2001 {
74 t.Fatalf("Expected IncrementRoundCount to return 2001, got %d", newRC)
75 }
76 if GetRoundCount() != 2001 {
77 t.Fatalf("Expected roundCount to be 2001, got %d", GetRoundCount())
78 }
79}
80
81func TestTurnCount(t *testing.T) {
82 // turnCount is also a global variable.

Callers

nothing calls this directly

Calls 3

SetRoundCountFunction · 0.85
GetRoundCountFunction · 0.85
IncrementRoundCountFunction · 0.85

Tested by

no test coverage detected