array-iterator.go: changed 'list' name component with 'array'
This commit is contained in:
+8
-8
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
func TestNewListIterator(t *testing.T) {
|
||||
a := array.NewArrayA("a", "b", "c", "d")
|
||||
it := NewListIterator(a, []any{1, 3, 1})
|
||||
it := NewArrayIteratorFromArray(a, []any{1, 3, 1})
|
||||
if item, err := it.Next(); err != nil {
|
||||
t.Errorf("error: %v", err)
|
||||
} else if item != "b" {
|
||||
@@ -25,7 +25,7 @@ func TestNewListIterator(t *testing.T) {
|
||||
|
||||
func TestNewListIterator2(t *testing.T) {
|
||||
a := array.NewArrayA("a", "b", "c", "d")
|
||||
it := NewListIterator(a, []any{3, 1, -1})
|
||||
it := NewArrayIteratorFromArray(a, []any{3, 1, -1})
|
||||
if item, err := it.Next(); err != nil {
|
||||
t.Errorf("error: %v", err)
|
||||
} else if item != "d" {
|
||||
@@ -37,7 +37,7 @@ func TestNewListIterator2(t *testing.T) {
|
||||
|
||||
func TestNewListIterator3(t *testing.T) {
|
||||
a := array.NewArrayA("a", "b", "c", "d")
|
||||
it := NewListIterator(a, []any{1, -1, 1})
|
||||
it := NewArrayIteratorFromArray(a, []any{1, -1, 1})
|
||||
if item, err := it.Next(); err != nil {
|
||||
t.Errorf("error: %v", err)
|
||||
} else if item != "b" {
|
||||
@@ -116,7 +116,7 @@ func TestNewString(t *testing.T) {
|
||||
func TestHasOperation(t *testing.T) {
|
||||
|
||||
a := array.NewArrayA("a", "b", "c", "d")
|
||||
it := NewListIterator(a, []any{1, 3, 1})
|
||||
it := NewArrayIteratorFromArray(a, []any{1, 3, 1})
|
||||
hasOp := it.HasOperation("reset")
|
||||
if !hasOp {
|
||||
t.Errorf("HasOperation(reset) must be true, got false")
|
||||
@@ -126,7 +126,7 @@ func TestHasOperation(t *testing.T) {
|
||||
func TestCallOperationReset(t *testing.T) {
|
||||
|
||||
a := array.NewArrayA("a", "b", "c", "d")
|
||||
it := NewListIterator(a, []any{1, 3, 1})
|
||||
it := NewArrayIteratorFromArray(a, []any{1, 3, 1})
|
||||
if v, err := it.CallOperation("reset", nil); err != nil {
|
||||
t.Errorf("Error on CallOperation(reset): %v", err)
|
||||
} else {
|
||||
@@ -137,7 +137,7 @@ func TestCallOperationReset(t *testing.T) {
|
||||
func TestCallOperationIndex(t *testing.T) {
|
||||
|
||||
a := array.NewArrayA("a", "b", "c", "d")
|
||||
it := NewListIterator(a, []any{1, 3, 1})
|
||||
it := NewArrayIteratorFromArray(a, []any{1, 3, 1})
|
||||
if v, err := it.CallOperation("index", nil); err != nil {
|
||||
t.Errorf("Error on CallOperation(index): %v", err)
|
||||
} else {
|
||||
@@ -148,7 +148,7 @@ func TestCallOperationIndex(t *testing.T) {
|
||||
func TestCallOperationCount(t *testing.T) {
|
||||
|
||||
a := array.NewArrayA("a", "b", "c", "d")
|
||||
it := NewListIterator(a, []any{1, 3, 1})
|
||||
it := NewArrayIteratorFromArray(a, []any{1, 3, 1})
|
||||
if v, err := it.CallOperation("count", nil); err != nil {
|
||||
t.Errorf("Error on CallOperation(count): %v", err)
|
||||
} else {
|
||||
@@ -159,7 +159,7 @@ func TestCallOperationCount(t *testing.T) {
|
||||
func TestCallOperationUnknown(t *testing.T) {
|
||||
|
||||
a := array.NewArrayA("a", "b", "c", "d")
|
||||
it := NewListIterator(a, []any{1, 3, 1})
|
||||
it := NewArrayIteratorFromArray(a, []any{1, 3, 1})
|
||||
if v, err := it.CallOperation("unknown", nil); err == nil {
|
||||
t.Errorf("Expected error on CallOperation(unknown), got %v", v)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user