mirror of
https://github.com/tursom/GoCollections.git
synced 2025-03-13 17:00:18 +08:00
27 lines
472 B
Go
27 lines
472 B
Go
/*
|
|
* 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.
|
|
*/
|
|
|
|
package util
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/tursom/GoCollections/lang"
|
|
)
|
|
|
|
func Test_arrayList_Get(t *testing.T) {
|
|
l := arrayList[lang.Int]{array: []lang.Int{1, 2}}
|
|
for i := 0; i < l.Size()+1; i++ {
|
|
r, err := l.Get(i)
|
|
if err != nil {
|
|
err.PrintStackTrace()
|
|
} else {
|
|
fmt.Println(r)
|
|
}
|
|
}
|
|
}
|