mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-10 22:52:51 +09:00
Add persistent undo as the option
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
package main
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestStack(t *testing.T) {
|
||||
stack := new(Stack)
|
||||
|
||||
if stack.Len() != 0 {
|
||||
t.Errorf("Len failed")
|
||||
}
|
||||
stack.Push(5)
|
||||
stack.Push("test")
|
||||
stack.Push(10)
|
||||
if stack.Len() != 3 {
|
||||
t.Errorf("Len failed")
|
||||
}
|
||||
|
||||
var popped interface{}
|
||||
popped = stack.Pop()
|
||||
if popped != 10 {
|
||||
t.Errorf("Pop failed")
|
||||
}
|
||||
|
||||
popped = stack.Pop()
|
||||
if popped != "test" {
|
||||
t.Errorf("Pop failed")
|
||||
}
|
||||
|
||||
stack.Push("test")
|
||||
popped = stack.Pop()
|
||||
if popped != "test" {
|
||||
t.Errorf("Pop failed")
|
||||
}
|
||||
stack.Pop()
|
||||
popped = stack.Pop()
|
||||
if popped != nil {
|
||||
t.Errorf("Pop failed")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user