mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 19:05:42 +03:00
* client: refactor cgroups management in client * client: fingerprint numa topology * client: plumb numa and cgroups changes to drivers * client: cleanup task resource accounting * client: numa client and config plumbing * lib: add a stack implementation * tools: remove ec2info tool * plugins: fixup testing for cgroups / numa changes * build: update makefile and package tests and cl
33 lines
440 B
Go
33 lines
440 B
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
package lang
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/shoenig/test/must"
|
|
)
|
|
|
|
func Test_Stack(t *testing.T) {
|
|
s := NewStack[int]()
|
|
|
|
must.True(t, s.Empty())
|
|
|
|
s.Push(1)
|
|
s.Push(2)
|
|
s.Push(3)
|
|
must.NotEmpty(t, s)
|
|
|
|
must.Eq(t, 3, s.Pop())
|
|
must.Eq(t, 2, s.Pop())
|
|
|
|
s.Push(4)
|
|
s.Push(5)
|
|
|
|
must.Eq(t, 5, s.Pop())
|
|
must.Eq(t, 4, s.Pop())
|
|
must.Eq(t, 1, s.Pop())
|
|
must.Empty(t, s)
|
|
}
|