var type checking, fix importing, fix creating empty lists, repl command, dynamic stacks
This commit is contained in:
parent
f633a02c32
commit
5bcab07681
11 changed files with 407 additions and 284 deletions
|
|
@ -25,16 +25,10 @@ func TestNewStack(t *testing.T) {
|
|||
|
||||
s := NewStack[any](Pos(size))
|
||||
|
||||
if s.Size != Pos(size) {
|
||||
t.Errorf("Stack size (%d) does not match expected size (%d)", s.Size, size)
|
||||
if s.Capacity != Pos(size) {
|
||||
t.Errorf("Stack size (%d) does not match expected size (%d)", s.Capacity, size)
|
||||
} else {
|
||||
t.Logf("Stack size is expected size (%d)", s.Size)
|
||||
}
|
||||
|
||||
if len(s.items) != size {
|
||||
t.Errorf("internal items slice size (%d) does not match expected size (%d)", len(s.items), size)
|
||||
} else {
|
||||
t.Logf("internal items slice size is as expected (%d)", len(s.items))
|
||||
t.Logf("Stack size is expected size (%d)", s.Capacity)
|
||||
}
|
||||
|
||||
if s.Current != 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue