mirror of
https://github.com/fumiama/terasu-cloudflared.git
synced 2026-06-09 04:30:31 +08:00
TUN-528: Move cloudflared into a separate repo
This commit is contained in:
42
vendor/github.com/golang-collections/collections/stack/stack_test.go
generated
vendored
Normal file
42
vendor/github.com/golang-collections/collections/stack/stack_test.go
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
package stack
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func Test(t *testing.T) {
|
||||
s := New()
|
||||
|
||||
if s.Len() != 0 {
|
||||
t.Errorf("Length of an empty stack should be 0")
|
||||
}
|
||||
|
||||
s.Push(1)
|
||||
|
||||
if s.Len() != 1 {
|
||||
t.Errorf("Length should be 0")
|
||||
}
|
||||
|
||||
if s.Peek().(int) != 1 {
|
||||
t.Errorf("Top item on the stack should be 1")
|
||||
}
|
||||
|
||||
if s.Pop().(int) != 1 {
|
||||
t.Errorf("Top item should have been 1")
|
||||
}
|
||||
|
||||
if s.Len() != 0 {
|
||||
t.Errorf("Stack should be empty")
|
||||
}
|
||||
|
||||
s.Push(1)
|
||||
s.Push(2)
|
||||
|
||||
if s.Len() != 2 {
|
||||
t.Errorf("Length should be 2")
|
||||
}
|
||||
|
||||
if s.Peek().(int) != 2 {
|
||||
t.Errorf("Top of the stack should be 2")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user