blob: 852332367c1c36da2f89c71674e0a0d82ec55098 [file] [log] [blame]
// Copyright 2020 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import "./a"
func main() {
var s a.Stack[string]
s.Push("hi")
s.Push("bye")
if s.IsEmpty() {
panic("unexpected IsEmpty")
}
if s.Len() != 2 {
panic("bad Len")
}
if v, ok := s.Pop(); !ok || v != "bye" {
panic("bad Pop 1")
}
if v, ok := s.Pop(); !ok || v != "hi" {
panic("bad Pop 2")
}
if !s.IsEmpty() {
panic("expected IsEmpty")
}
if s.Len() != 0 {
panic("bad Len 2")
}
}