(t *testing.T)
| 67 | } |
| 68 | |
| 69 | func TestStackPush(t *testing.T) { |
| 70 | file := fmt.Sprintf("test_db_%d", time.Now().UnixNano()) |
| 71 | s, err := OpenStack(file) |
| 72 | if err != nil { |
| 73 | t.Error(err) |
| 74 | } |
| 75 | defer s.Drop() |
| 76 | |
| 77 | for i := 1; i <= 10; i++ { |
| 78 | if _, err = s.PushString(fmt.Sprintf("value for item %d", i)); err != nil { |
| 79 | t.Error(err) |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | if s.Length() != 10 { |
| 84 | t.Errorf("Expected stack size of 10, got %d", s.Length()) |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | func TestStackPop(t *testing.T) { |
| 89 | file := fmt.Sprintf("test_db_%d", time.Now().UnixNano()) |
nothing calls this directly
no test coverage detected