MCPcopy
hub / github.com/TheAlgorithms/Go / TestDelete

Function TestDelete

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

Source from the content-addressed store, hash-verified

69}
70
71func TestDelete(t *testing.T) {
72 list := NewCyclic[int]()
73 fillList(list, 3)
74
75 want := 2
76 wantSize := 2
77 list.Delete()
78 got := list.Head.Val
79 if want != got {
80 t.Errorf("got: %v, want: %v", got, want)
81 }
82 if wantSize != list.Size {
83 t.Errorf("got: %v, want: %v", got, want)
84 }
85}
86
87func TestDestroy(t *testing.T) {
88 list := NewCyclic[int]()

Callers

nothing calls this directly

Calls 2

fillListFunction · 0.85
DeleteMethod · 0.65

Tested by

no test coverage detected