at operator return -1 when fails in lists and arrays; insert operators (<< and >>) changes che container if it is a variable

This commit is contained in:
2026-07-16 07:25:15 +02:00
parent 8c55f4ac4b
commit 2f616f349b
11 changed files with 105 additions and 60 deletions
+2 -2
View File
@@ -38,10 +38,10 @@ func TestLinkedInsert(t *testing.T) {
section := "LinkedList-Insert"
inputs := []inputType{
/* 1 */ {`[<>] << 1`, list.NewLinkedListA(1), nil},
/* 2 */ {`[<>] << [1,2]`, list.NewLinkedListA(array.NewArrayA(int64(1), int64(2))), nil},
/* 2 */ {`[<>] << [1,2]`, list.NewLinkedListA(array.ArrayFromIntsA(1, 2)), nil},
/* 3 */ {`[<>] << [<1,2>]`, list.NewLinkedListA(list.NewLinkedListA(1, 2)), nil},
/* 4 */ {`1 >> [<>]`, list.NewLinkedListA(1), nil},
/* 5 */ {`[1,2] >> [<>]`, list.NewLinkedListA(array.NewArrayA(int64(1), int64(2))), nil},
/* 5 */ {`[1,2] >> [<>]`, list.NewLinkedListA(array.ArrayFromIntsA(1, 2)), nil},
/* 6 */ {`[<1,2>] >> [<>]`, list.NewLinkedListA(list.NewLinkedListA(1, 2)), nil},
/* 7 */ {`$([1,2]) >> [<>]`, list.NewLinkedListA(1, 2), nil},
/* 8 */ {`$([<1,2>]) >> [<>]`, list.NewLinkedListA(1, 2), nil},