diff --git a/exercises/practice/accumulate/testlib/t3.rexx b/exercises/practice/accumulate/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/accumulate/testlib/t3.rexx +++ b/exercises/practice/accumulate/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/acronym/testlib/t3.rexx b/exercises/practice/acronym/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/acronym/testlib/t3.rexx +++ b/exercises/practice/acronym/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/all-your-base/testlib/t3.rexx b/exercises/practice/all-your-base/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/all-your-base/testlib/t3.rexx +++ b/exercises/practice/all-your-base/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/anagram/testlib/t3.rexx b/exercises/practice/anagram/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/anagram/testlib/t3.rexx +++ b/exercises/practice/anagram/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/armstrong-numbers/testlib/t3.rexx b/exercises/practice/armstrong-numbers/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/armstrong-numbers/testlib/t3.rexx +++ b/exercises/practice/armstrong-numbers/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/atbash-cipher/testlib/t3.rexx b/exercises/practice/atbash-cipher/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/atbash-cipher/testlib/t3.rexx +++ b/exercises/practice/atbash-cipher/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/bank-account/testlib/t3.rexx b/exercises/practice/bank-account/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/bank-account/testlib/t3.rexx +++ b/exercises/practice/bank-account/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/beer-song/testlib/t3.rexx b/exercises/practice/beer-song/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/beer-song/testlib/t3.rexx +++ b/exercises/practice/beer-song/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/binary-search/testlib/t3.rexx b/exercises/practice/binary-search/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/binary-search/testlib/t3.rexx +++ b/exercises/practice/binary-search/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/bob/testlib/t3.rexx b/exercises/practice/bob/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/bob/testlib/t3.rexx +++ b/exercises/practice/bob/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/clock/testlib/t3.rexx b/exercises/practice/clock/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/clock/testlib/t3.rexx +++ b/exercises/practice/clock/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/collatz-conjecture/testlib/t3.rexx b/exercises/practice/collatz-conjecture/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/collatz-conjecture/testlib/t3.rexx +++ b/exercises/practice/collatz-conjecture/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/custom-set/testlib/t3.rexx b/exercises/practice/custom-set/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/custom-set/testlib/t3.rexx +++ b/exercises/practice/custom-set/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/darts/testlib/t3.rexx b/exercises/practice/darts/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/darts/testlib/t3.rexx +++ b/exercises/practice/darts/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/difference-of-squares/testlib/t3.rexx b/exercises/practice/difference-of-squares/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/difference-of-squares/testlib/t3.rexx +++ b/exercises/practice/difference-of-squares/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/error-handling/testlib/t3.rexx b/exercises/practice/error-handling/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/error-handling/testlib/t3.rexx +++ b/exercises/practice/error-handling/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/etl/testlib/t3.rexx b/exercises/practice/etl/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/etl/testlib/t3.rexx +++ b/exercises/practice/etl/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/gigasecond/testlib/t3.rexx b/exercises/practice/gigasecond/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/gigasecond/testlib/t3.rexx +++ b/exercises/practice/gigasecond/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/grade-school/testlib/t3.rexx b/exercises/practice/grade-school/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/grade-school/testlib/t3.rexx +++ b/exercises/practice/grade-school/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/grains/testlib/t3.rexx b/exercises/practice/grains/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/grains/testlib/t3.rexx +++ b/exercises/practice/grains/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/hamming/testlib/t3.rexx b/exercises/practice/hamming/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/hamming/testlib/t3.rexx +++ b/exercises/practice/hamming/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/hello-world/testlib/t3.rexx b/exercises/practice/hello-world/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/hello-world/testlib/t3.rexx +++ b/exercises/practice/hello-world/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/high-scores/testlib/t3.rexx b/exercises/practice/high-scores/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/high-scores/testlib/t3.rexx +++ b/exercises/practice/high-scores/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/house/testlib/t3.rexx b/exercises/practice/house/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/house/testlib/t3.rexx +++ b/exercises/practice/house/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/isbn-verifier/testlib/t3.rexx b/exercises/practice/isbn-verifier/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/isbn-verifier/testlib/t3.rexx +++ b/exercises/practice/isbn-verifier/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/isogram/testlib/t3.rexx b/exercises/practice/isogram/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/isogram/testlib/t3.rexx +++ b/exercises/practice/isogram/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/leap/testlib/t3.rexx b/exercises/practice/leap/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/leap/testlib/t3.rexx +++ b/exercises/practice/leap/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/list-ops/testlib/t3.rexx b/exercises/practice/list-ops/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/list-ops/testlib/t3.rexx +++ b/exercises/practice/list-ops/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/luhn/testlib/t3.rexx b/exercises/practice/luhn/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/luhn/testlib/t3.rexx +++ b/exercises/practice/luhn/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/matching-brackets/testlib/t3.rexx b/exercises/practice/matching-brackets/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/matching-brackets/testlib/t3.rexx +++ b/exercises/practice/matching-brackets/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/matrix/testlib/t3.rexx b/exercises/practice/matrix/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/matrix/testlib/t3.rexx +++ b/exercises/practice/matrix/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/nth-prime/testlib/t3.rexx b/exercises/practice/nth-prime/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/nth-prime/testlib/t3.rexx +++ b/exercises/practice/nth-prime/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/nucleotide-count/testlib/t3.rexx b/exercises/practice/nucleotide-count/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/nucleotide-count/testlib/t3.rexx +++ b/exercises/practice/nucleotide-count/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/ocr-numbers/testlib/t3.rexx b/exercises/practice/ocr-numbers/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/ocr-numbers/testlib/t3.rexx +++ b/exercises/practice/ocr-numbers/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/pangram/testlib/t3.rexx b/exercises/practice/pangram/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/pangram/testlib/t3.rexx +++ b/exercises/practice/pangram/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/perfect-numbers/testlib/t3.rexx b/exercises/practice/perfect-numbers/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/perfect-numbers/testlib/t3.rexx +++ b/exercises/practice/perfect-numbers/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/phone-number/testlib/t3.rexx b/exercises/practice/phone-number/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/phone-number/testlib/t3.rexx +++ b/exercises/practice/phone-number/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/prime-factors/testlib/t3.rexx b/exercises/practice/prime-factors/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/prime-factors/testlib/t3.rexx +++ b/exercises/practice/prime-factors/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/protein-translation/testlib/t3.rexx b/exercises/practice/protein-translation/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/protein-translation/testlib/t3.rexx +++ b/exercises/practice/protein-translation/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/proverb/testlib/t3.rexx b/exercises/practice/proverb/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/proverb/testlib/t3.rexx +++ b/exercises/practice/proverb/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/queen-attack/testlib/t3.rexx b/exercises/practice/queen-attack/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/queen-attack/testlib/t3.rexx +++ b/exercises/practice/queen-attack/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/raindrops/testlib/t3.rexx b/exercises/practice/raindrops/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/raindrops/testlib/t3.rexx +++ b/exercises/practice/raindrops/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/resistor-color-duo/testlib/t3.rexx b/exercises/practice/resistor-color-duo/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/resistor-color-duo/testlib/t3.rexx +++ b/exercises/practice/resistor-color-duo/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/resistor-color-trio/testlib/t3.rexx b/exercises/practice/resistor-color-trio/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/resistor-color-trio/testlib/t3.rexx +++ b/exercises/practice/resistor-color-trio/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/resistor-color/testlib/t3.rexx b/exercises/practice/resistor-color/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/resistor-color/testlib/t3.rexx +++ b/exercises/practice/resistor-color/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/reverse-string/testlib/t3.rexx b/exercises/practice/reverse-string/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/reverse-string/testlib/t3.rexx +++ b/exercises/practice/reverse-string/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/rna-transcription/testlib/t3.rexx b/exercises/practice/rna-transcription/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/rna-transcription/testlib/t3.rexx +++ b/exercises/practice/rna-transcription/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/roman-numerals/testlib/t3.rexx b/exercises/practice/roman-numerals/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/roman-numerals/testlib/t3.rexx +++ b/exercises/practice/roman-numerals/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/rotational-cipher/testlib/t3.rexx b/exercises/practice/rotational-cipher/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/rotational-cipher/testlib/t3.rexx +++ b/exercises/practice/rotational-cipher/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/saddle-points/testlib/t3.rexx b/exercises/practice/saddle-points/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/saddle-points/testlib/t3.rexx +++ b/exercises/practice/saddle-points/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/scrabble-score/testlib/t3.rexx b/exercises/practice/scrabble-score/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/scrabble-score/testlib/t3.rexx +++ b/exercises/practice/scrabble-score/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/secret-handshake/testlib/t3.rexx b/exercises/practice/secret-handshake/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/secret-handshake/testlib/t3.rexx +++ b/exercises/practice/secret-handshake/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/series/testlib/t3.rexx b/exercises/practice/series/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/series/testlib/t3.rexx +++ b/exercises/practice/series/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/sieve/testlib/t3.rexx b/exercises/practice/sieve/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/sieve/testlib/t3.rexx +++ b/exercises/practice/sieve/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/simple-cipher/testlib/t3.rexx b/exercises/practice/simple-cipher/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/simple-cipher/testlib/t3.rexx +++ b/exercises/practice/simple-cipher/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/space-age/testlib/t3.rexx b/exercises/practice/space-age/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/space-age/testlib/t3.rexx +++ b/exercises/practice/space-age/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/square-root/testlib/t3.rexx b/exercises/practice/square-root/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/square-root/testlib/t3.rexx +++ b/exercises/practice/square-root/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/strain/testlib/t3.rexx b/exercises/practice/strain/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/strain/testlib/t3.rexx +++ b/exercises/practice/strain/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/sublist/testlib/t3.rexx b/exercises/practice/sublist/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/sublist/testlib/t3.rexx +++ b/exercises/practice/sublist/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/sum-of-multiples/testlib/t3.rexx b/exercises/practice/sum-of-multiples/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/sum-of-multiples/testlib/t3.rexx +++ b/exercises/practice/sum-of-multiples/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/transpose/testlib/t3.rexx b/exercises/practice/transpose/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/transpose/testlib/t3.rexx +++ b/exercises/practice/transpose/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/triangle/testlib/t3.rexx b/exercises/practice/triangle/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/triangle/testlib/t3.rexx +++ b/exercises/practice/triangle/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/twelve-days/testlib/t3.rexx b/exercises/practice/twelve-days/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/twelve-days/testlib/t3.rexx +++ b/exercises/practice/twelve-days/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/two-fer/testlib/t3.rexx b/exercises/practice/two-fer/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/two-fer/testlib/t3.rexx +++ b/exercises/practice/two-fer/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || , diff --git a/exercises/practice/word-count/testlib/t3.rexx b/exercises/practice/word-count/testlib/t3.rexx index 331e1e7..56d6aea 100644 --- a/exercises/practice/word-count/testlib/t3.rexx +++ b/exercises/practice/word-count/testlib/t3.rexx @@ -20,7 +20,7 @@ /* functions for the test framework */ -init: +init : parse upper arg outputType checkNumber = 0 count = 0 @@ -32,15 +32,22 @@ init: divider = '----------------------------------------' spacer = ' ' EOL = "0A"X + output. = '' ; output.0 = 0 return +output : procedure expose output. + parse arg line + output.0 = output.0 + 1 + n = output.0 ; output.n = line +return '' + context : procedure expose contextdesc TASK_ID parse arg desc, task_identifier contextdesc = desc if task_identifier \= '' then ; TASK_ID = task_identifier return '' -check: +check : parse arg description, procedureCall, variableName, operation, expectedValue checkNumber = checkNumber + 1 @@ -81,13 +88,18 @@ check: testCode = procedureCall op expectedValue else testCode = procedureCall op "'"expectedValue"'" + /* Assemble collected output */ + output = '' + do i = 1 to output.0 + output = output || output.i || EOL + end /* Package test results as JSON */ checkresult.count = , MakeJSONTestResult( , description,, testStatus,, 'Expected' expectedValue conjunction 'got' returnedValue,, - '',, + output,, testCode,, TASK_ID,, EOL) @@ -98,7 +110,7 @@ check: return '' -expect: +expect : parse arg actual, variableName, op, expected if variableName <> '' then @@ -166,8 +178,9 @@ return text MakeJSONTestResult : procedure parse arg name, status, message, output, test_code, task_id, eol - message = CHANGESTR('"', CHANGESTR("0A"X, message, '\n'), '\"') - test_code = CHANGESTR('"', CHANGESTR("0A"X, test_code, '\n'), '\"') + message = CHANGESTR('"', CHANGESTR(eol, message, '\n'), '\"') + output = CHANGESTR('"', CHANGESTR(eol, output, '\n'), '\"') + test_code = CHANGESTR('"', CHANGESTR(eol, test_code, '\n'), '\"') json = , ' {' || eol || , ' "name": "' || name || '",' || eol || ,