MCPcopy Create free account
hub / github.com/betty200744/ultimate-go / TestStack_Max

Function TestStack_Max

algorithms/data-structures/stack/stack_test.go:21–38  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19 fmt.Println(s.IsEmpty())
20}
21func TestStack_Max(t *testing.T) {
22 t.Run("int", func(t *testing.T) {
23 s := New()
24 s.Push(1)
25 s.Push(2)
26 s.Push(3)
27 s.Push(4)
28 assert.Equal(t, 4, s.Max())
29 })
30 t.Run("string", func(t *testing.T) {
31 s := New()
32 s.Push("a")
33 s.Push("b")
34 s.Push("c")
35 s.Push("d")
36 assert.Equal(t, "d", s.Max())
37 })
38}

Callers

nothing calls this directly

Calls 4

MaxMethod · 0.80
NewFunction · 0.70
PushMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected