GoCollections/util/arrayList_test.go

27 lines
472 B
Go
Raw Normal View History

2022-11-25 18:19:33 +08:00
/*
* Copyright (c) 2022 tursom. All rights reserved.
* Use of this source code is governed by a GPL-3
* license that can be found in the LICENSE file.
*/
2022-03-21 11:02:41 +08:00
package util
import (
"fmt"
"testing"
2022-11-25 18:19:33 +08:00
"github.com/tursom/GoCollections/lang"
2022-03-21 11:02:41 +08:00
)
func Test_arrayList_Get(t *testing.T) {
2022-04-02 15:25:35 +08:00
l := arrayList[lang.Int]{array: []lang.Int{1, 2}}
2022-03-21 11:02:41 +08:00
for i := 0; i < l.Size()+1; i++ {
r, err := l.Get(i)
if err != nil {
err.PrintStackTrace()
} else {
fmt.Println(r)
}
}
}