regression test updates

This commit is contained in:
Robert Bendun 2022-10-31 00:39:56 +01:00
parent bfbc82d6a5
commit fa853e000f
9 changed files with 116 additions and 17 deletions

View File

@ -1,8 +1,8 @@
-- Call executes blocks without parameters
say (call [42]),
say (call (|42)),
-- Call executes block passing parameters
say (call [n | n + 1] 10),
say (call (n | n + 1) 10),
-- Call executes builtin functions
call say 43,

View File

@ -1,13 +1,13 @@
-- If executes then first block when condition is true
if true [say 1],
if true [say 2] [say 3],
if true (say 1),
if true (say 2) (say 3),
-- If executes second block when condition is false
if false [say 4] [say 5],
if false (say 4) (say 5),
-- If returns nil when without else block
say (if false [say 6]),
say (if false (say 6)),
-- If returns block execution value
say (if true [7]),
say (if false [say 100, 8] [say 200, 9]),
say (if true (7)),
say (if false (say 100, 8) (say 200, 9)),

View File

@ -3,4 +3,4 @@ say (max (200 + up 10)),
say (max (100 + down 10)),
-- Max should do deep search
say (max 1 2 [3, 4, [5, 10, 8], 1] 2),
say (max 1 2 (3, 4, (5, 10, 8), 1) 2),

View File

@ -3,4 +3,4 @@ say (min (200 + up 10)),
say (min (100 + down 10)),
-- Min should do deep search
say (min 1 2 [3, 4, [5, 0, 8], 1] 2),
say (min 1 2 (3, 4, (5, 0, 8), 1) 2),

View File

@ -1,4 +1,4 @@
say (reverse []),
say (reverse ()),
say (reverse (up 10)),
say (reverse (reverse (up 10))),
say (reverse [[1, 2, 3], 4, 5] 6 7 [[8, 9]]),
say (reverse ((1, 2, 3), 4, 5) 6 7 ((8, 9))),

View File

@ -1,6 +1,6 @@
say (typeof (call flat)),
say (typeof 0),
say (typeof []),
say (typeof ()),
say (typeof c),
say (typeof false),
say (typeof nil),

View File

@ -1,5 +1,5 @@
say (uniq (up 10 & down 10)),
say (uniq [1,1,1,3,5,3,4,4,1]),
say (uniq (1,1,1,3,5,3,4,4,1)),
-- Multiple uniq applications shouldn't matter
say (uniq (uniq [1,1,1,3,5,3,4,4,1])),
say (uniq (uniq (1,1,1,3,5,3,4,4,1))),

View File

@ -1,5 +1,5 @@
say (unique (up 10 & down 10)),
say (unique [1,1,1,3,5,3,4,4,1]),
say (unique (1,1,1,3,5,3,4,4,1)),
-- Multiple unique applications shouldn't matter
say (unique (unique [1,1,1,3,5,3,4,4,1])),
say (unique (unique (1,1,1,3,5,3,4,4,1))),

View File

@ -101,6 +101,105 @@
"(9, 7, 5, 3, 1)"
],
"stderr_lines": []
},
{
"name": "min.mq",
"exit_code": 0,
"stdin_lines": [],
"stdout_lines": [
"1",
"200",
"100",
"0"
],
"stderr_lines": []
},
{
"name": "call.mq",
"exit_code": 0,
"stdin_lines": [],
"stdout_lines": [
"42",
"11",
"43"
],
"stderr_lines": []
},
{
"name": "if.mq",
"exit_code": 0,
"stdin_lines": [],
"stdout_lines": [
"1",
"2",
"5",
"nil",
"7",
"200",
"9"
],
"stderr_lines": []
},
{
"name": "uniq.mq",
"exit_code": 0,
"stdin_lines": [],
"stdout_lines": [
"(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)",
"(1, 3, 5, 3, 4, 1)",
"(1, 3, 5, 3, 4, 1)"
],
"stderr_lines": []
},
{
"name": "reverse.mq",
"exit_code": 0,
"stdin_lines": [],
"stdout_lines": [
"()",
"(9, 8, 7, 6, 5, 4, 3, 2, 1, 0)",
"(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)",
"(9, 8, 7, 6, 5, 4, (1, 2, 3))"
],
"stderr_lines": []
},
{
"name": "typeof.mq",
"exit_code": 0,
"stdin_lines": [],
"stdout_lines": [
"array",
"number",
"block",
"music",
"bool",
"nil",
"intrinsic"
],
"stderr_lines": []
},
{
"name": "unique.mq",
"exit_code": 0,
"stdin_lines": [],
"stdout_lines": [
"(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)",
"(1, 3, 5, 4)",
"(1, 3, 5, 4)"
],
"stderr_lines": []
},
{
"name": "max.mq",
"exit_code": 0,
"stdin_lines": [],
"stdout_lines": [
"5",
"209",
"109",
"10"
],
"stderr_lines": []
}
]
}