mirror of
https://github.com/emirpasic/gods.git
synced 2026-06-15 16:16:35 +03:00
ArrayList addition (inc. test, example and documentation)
This commit is contained in:
@@ -27,6 +27,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
package arraystack
|
||||
|
||||
import (
|
||||
"github.com/emirpasic/gods/utils"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -43,6 +44,10 @@ func TestArrayStack(t *testing.T) {
|
||||
stack.Push(2)
|
||||
stack.Push(3)
|
||||
|
||||
if actualValue := stack.Values(); !utils.IdenticalSlices(actualValue, []interface{}{3, 2, 1}) {
|
||||
t.Errorf("Got %v expected %v", actualValue, []interface{}{3, 2, 1})
|
||||
}
|
||||
|
||||
if actualValue := stack.Empty(); actualValue != false {
|
||||
t.Errorf("Got %v expected %v", actualValue, false)
|
||||
}
|
||||
@@ -77,6 +82,10 @@ func TestArrayStack(t *testing.T) {
|
||||
t.Errorf("Got %v expected %v", actualValue, true)
|
||||
}
|
||||
|
||||
if actualValue := stack.Values(); !utils.IdenticalSlices(actualValue, []interface{}{}) {
|
||||
t.Errorf("Got %v expected %v", actualValue, []interface{}{})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func BenchmarkArrayStack(b *testing.B) {
|
||||
|
||||
Reference in New Issue
Block a user