MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / TestDestroy

Function TestDestroy

structure/linkedlist/cyclic_test.go:87–102  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

85}
86
87func TestDestroy(t *testing.T) {
88 list := NewCyclic[int]()
89 fillList(list, 3)
90 wantSize := 0
91 list.Destroy()
92
93 got := list.Head
94
95 if got != nil {
96 t.Errorf("got: %v, want: nil", got)
97 }
98
99 if wantSize != list.Size {
100 t.Errorf("got: %v, want: %v", got, wantSize)
101 }
102}
103
104func TestJosephusProblem(t *testing.T) {
105 type testCase struct {

Callers

nothing calls this directly

Calls 2

fillListFunction · 0.85
DestroyMethod · 0.80

Tested by

no test coverage detected