
-- Copied from array.testGroup for ooRexx5
-- and adapted.


-- tests for Array Term

ooRexx> a = ,;
ooRexx> say a~ppRepresentation -- [..]
[..]
ooRexx> say a~shape~ppRepresentation --[2]
[ 2]

ooRexx> a = (,)
ooRexx> say a~ppRepresentation -- [..]
[..]
ooRexx> say a~shape~ppRepresentation --[2]
[ 2]

ooRexx> a = .nil,;
ooRexx> say a~ppRepresentation -- [(The NIL object),..]
[(The NIL object),..]
ooRexx> say a~shape~ppRepresentation -- [2]
[ 2]

ooRexx> a = .nil, .nil
ooRexx> say a~ppRepresentation -- [(The NIL object),(The NIL object)]
[(The NIL object),(The NIL object)]
ooRexx> say a~shape~ppRepresentation -- [2]
[ 2]

ooRexx> a = ("string", ,)
ooRexx> say a~ppRepresentation -- ['string',..]
['string',..]
ooRexx> say a~shape~ppRepresentation -- [3]
[ 3]

ooRexx> a = , , "string"
ooRexx> say a~ppRepresentation -- [..,'string']
[..,'string']
ooRexx> say a~shape~ppRepresentation -- [3]
[ 3]

ooRexx> a = (, "string",)
ooRexx> say a~ppRepresentation -- [..,'string',..]
[..,'string',..]
ooRexx> say a~shape~ppRepresentation -- [3]
[ 3]

ooRexx> a = 1, "two", 3, "four"
ooRexx> say a~ppRepresentation -- [1,'two',3,'four']
[ 1,'two', 3,'four']
ooRexx> say a~shape~ppRepresentation -- [4]
[ 4]

ooRexx> a = 1, "two", 3, "four", 5
ooRexx> say a~ppRepresentation -- [1,'two',3,'four',5]
[ 1,'two', 3,'four', 5]
ooRexx> say a~shape~ppRepresentation -- [5]
[ 5]

ooRexx> a = 1, "two", 3, "four", 5, "six"
ooRexx> say a~ppRepresentation -- [1,'two',3,'four',5,'six']
[ 1,'two', 3,'four', 5,'six']
ooRexx> say a~shape~ppRepresentation -- [6]
[ 6]

ooRexx> a = 1, "two", 3, "four", 5, "six", 7
ooRexx> say a~ppRepresentation -- [1,'two',3,'four',5,'six',7]
[ 1,'two', 3,'four', 5,'six', 7]
ooRexx> say a~shape~ppRepresentation -- [7]
[ 7]

ooRexx> a = 1, "two", 3, "four", 5, "six", 7, "eight"
ooRexx> say a~ppRepresentation -- [1,'two',3,'four',5,'six',7,'eight']
[ 1,'two', 3,'four', 5,'six', 7,'eight']
ooRexx> say a~shape~ppRepresentation -- [8]
[ 8]

ooRexx> a = 1, "two", 3, "four", 5, "six", 7, "eight", 9
ooRexx> say a~ppRepresentation -- [1,'two',3,'four',5,'six',7,'eight',9]
[ 1,'two', 3,'four', 5,'six', 7,'eight', 9]
ooRexx> say a~shape~ppRepresentation -- [9]
[ 9]

ooRexx> interpret "a =" "1, "~copies(10000)
ooRexx> say a~ppRepresentation(100) -- [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,...]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,...]
ooRexx> say a~shape~ppRepresentation -- [10000]
[ 10000]

ooRexx> a = (1, "two", 3)~~append("string")
ooRexx> say a~ppRepresentation -- [1,'two',3,'string']
[ 1,'two', 3,'string']
ooRexx> say a~shape~ppRepresentation -- [4]
[ 4]

--------------------------------------------------------------------------------
-- more tests

-- [oorexx:bugs] #2025 a[1] = 1,2,3 fails (fixed)
ooRexx> a = .array~new
ooRexx> a[1] = 1,2,3
ooRexx> say a~ppRepresentation -- [[1,2,3]]
[[ 1, 2, 3]]
ooRexx> say a~shape~ppRepresentation -- [1]
[ 1]

ooRexx> a = 1 + 10,20
ooRexx> say a~ppRepresentation -- [11,20]
[ 11, 20]
ooRexx> say a~shape~ppRepresentation -- [2]
[ 2]

ooRexx> a = 1 + (10,20)
ooRexx> say a~ppRepresentation -- [11,21]
[ 11, 21]
ooRexx> say a~shape~ppRepresentation -- [2]
[ 2]

ooRexx> a = 10,20 + 1
ooRexx> say a~ppRepresentation -- [10,21]
[ 10, 21]
ooRexx> say a~shape~ppRepresentation -- [2]
[ 2]

ooRexx> a = (10,20) + 1
ooRexx> say a~ppRepresentation -- [11,21]
[ 11, 21]
ooRexx> say a~shape~ppRepresentation -- [2]
[ 2]

ooRexx> a = 3+5i, 2-4i
ooRexx> say a~ppRepresentation -- [(3+5i),(2-4i)]
[(3+5i),(2-4i)]
ooRexx> say a~shape~ppRepresentation -- [2]
[ 2]

-- this is classic Rexx: an assignment with no value will reset the variable to ""
-- with ooRexx5: Error 35.918:  Missing expression following assignment instruction
ooRexx> interpret "a=,"
ooRexx> say a~class -- The String class
The String class
ooRexx> say a -- ""


ooRexx> call array_literal_continuation.rex
The String class
after continuation
[..,'after continuation']
[ 2]
The String class
1 2 3 4
The String class
1 2 4
[ 1, 2, 3, 4]
[ 4]
[ 1, 2,.., 4]
[ 4]
[..]
[ 2]
[..]
[ 2]
