aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2023-09-29ccwl: Allow steps with unspecified default arguments.Arun Isaac
* ccwl/ccwl.scm (function-inputs): New function. (function-input-keys): Use function-inputs. (collect-steps): Do not error out on steps with unspecified default arguments. * tests/ccwl.scm (print-with-default): New variable. ("allow steps with unspecified default arguments"): New test.
2023-09-20tests: Test that rename works even on a final workflow output.Arun Isaac
* tests/ccwl.scm (print): New variable. ("rename should work even on the final output of a workflow"): New test.
2022-01-16ccwl: Raise exceptions on command syntax errors.Arun Isaac
* ccwl/ccwl.scm (command): Raise &ccwl-violation conditions on syntax errors. * tests/ccwl.scm ("command, when passed positional arguments, must raise a &ccwl-violation condition", "command, when passed an unrecognized keyword, must raise a &ccwl-violation condition", "command, when passed multiple arguments to a unary keyword, must raise a &ccwl-violation condition"): New tests.
2022-01-16ccwl: Raise exceptions on output syntax errors.Arun Isaac
* ccwl/ccwl.scm (output): Raise &ccwl-violation conditions on syntax errors. * tests/ccwl.scm (output): New function. ("output, when passed more than one positional argument, must raise a &ccwl-violation condition", "output, when passed an unrecognized keyword, must raise a &ccwl-violation condition", "output, when passed multiple arguments to a unary keyword, must raise a &ccwl-violation condition"): New tests.
2022-01-16ccwl: Raise exceptions on input syntax errors.Arun Isaac
* ccwl/ccwl.scm: Import (rnrs conditions), (rnrs exceptions) and (ccwl conditions). (input, input-spec-id): Raise &ccwl-violation conditions on syntax errors. * tests/ccwl.scm: Import (rnrs exceptions) and (ccwl conditions). (input): New function. ("input, when passed more than one positional argument, must raise a &ccwl-violation condition", "input, when passed an unrecognized keyword, must raise a &ccwl-violation condition", "input, when passed multiple arguments to a unary keyword, must raise a &ccwl-violation condition"): New tests.
2022-01-16ccwl: Delete plist->alist.Arun Isaac
plist->alist is not used anywhere. pairify is quite sufficient to take on its functionality. * ccwl/utils.scm (plist->alist): Delete function. * tests/utils.scm ("plist->alist"): Delete test.
2022-01-16ccwl: Document default default value of syntax-lambda**.Arun Isaac
* ccwl/utils.scm (syntax-lambda**): Document default default value. * tests/utils.scm ("default default value of syntax-lambda** unary argument should be #f", "default default value of syntax-lambda** n-ary argument should be the empty list"): New tests.
2022-01-16ccwl: Clarify default default value of lambda**.Arun Isaac
* ccwl/utils.scm (lambda**): Change "default value" to "default default value" in docstring. * tests/utils.scm ("default value of lambda** unary argument should be #f", "default value of lambda** n-ary argument should be the empty list"): Change "default value" to "default default value".
2022-01-16tests: Move plist-ref ahead of test-begin.Arun Isaac
This is a purely cosmetic change just to keep definitions outside the test cases. * tests/utils.scm (plist-ref): Move ahead of test-begin.
2022-01-16ccwl: Raise lambda** and syntax-lambda** errors as exceptions.Arun Isaac
* ccwl/conditions.scm (&unrecognized-keyword-assertion, &invalid-keyword-arity-assertion, &invalid-positional-arguments-arity-assertion): New conditions. * ccwl/utils.scm: Import (rnrs conditions), (rnrs exceptions) and (ccwl conditions). (group-keyword-arguments): Raise &invalid-keyword-arity-assertion on error. (lambda**, syntax-lambda**): Raise &unrecognized-keyword-assertion, &invalid-keyword-arity-assertion and &invalid-positional-arguments-arity-assertion on error. * tests/utils.scm: Import (rnrs conditions), (rnrs exceptions), (srfi srfi-1) and (ccwl conditions). ("lambda** should raise an &unrecognized-keyword-assertion on unrecognized keywords in arguments with syntax objects as irritants"): Check for &unrecognized-keyword-assertion. ("Unrecognized keyword argument passed to lambda** should raise an &unrecognized-keyword-assertion condition", "Unary lambda** keyword argument passed multiple arguments should raise an &invalid-keyword-arity-assertion condition", "Wrong number of positional arguments to lambda** should raise an &invalid-positional-arguments-arity-assertion condition", "syntax-lambda** should raise an &unrecognized-keyword-assertion on unrecognized keywords in arguments", "Unrecognized keyword argument passed to syntax-lambda** should raise an &unrecognized-keyword-assertion condition with syntax objects as irritants", "Unary syntax-lambda** keyword argument passed multiple arguments should raise an &invalid-keyword-arity-assertion condition", "Wrong number of positional arguments to syntax-lambda** should raise an &invalid-positional-arguments-arity-assertion condition"): New tests.
2022-01-16tests: Use @@ instead of module-ref and resolve-module.Arun Isaac
@@ is shorter and looks neater with fewer quotes. * tests/ccwl.scm ("stdin input should not have inputBinding"), tests/utils.scm ("unsyntax-keywords"): Use @@ instead of module-ref and resolve-module.
2021-12-13ccwl: Support graphviz node ports.Arun Isaac
* ccwl/graphviz.scm (<graph-port>): New type. (serialize): Support <graph-port> objects. * tests/graphviz.scm (graph-port): New function. ("serialize ports correctly"): New test case.
2021-12-13ccwl: Escape only the double quote character in graphviz output.Arun Isaac
* ccwl/graphviz.scm: Import (ice-9 string-fun). (serialize): When quoting strings, escape only the double quote character. * tests/graphviz.scm ("do not escape backslashes"): New test case.
2021-12-13ccwl: Support graphviz HTML strings.Arun Isaac
* ccwl/graphviz.scm (<html-string>): New type. (escape-id): Delete function. (serialize): New function. (graph->dot): Use serialize instead of escape-id. * tests/graphviz.scm: New file. ("serialize HTML strings correctly"): New test case. * Makefile.am (SCM_TESTS): Register it.
2021-11-02tests: Add input-output-parameters.cwl.Arun Isaac
This is a follow-up to 0b359cf2c32cde81b4311d55273c8f6c14ca6b93 where this file should have been included. * tests/input-output-parameters.cwl: New file. * Makefile.am (EXTRA_DIST): Register it.
2021-11-02ccwl: Support external CWL workflows.Arun Isaac
* ccwl/ccwl.scm: Import (yaml). Export cwl-workflow?, cwl-workflow, cwl-workflow-file, cwl-workflow-inputs and cwl-workflow-outputs. (<cwl-workflow>): New type. (cwl-workflow, function-input-keys, function-outputs, function-object): New functions. (command-input-keys, command-object): Delete functions. (collect-steps): Replace command-object with function-object, command-input-keys with function-input-keys and command-outputs with function-outputs. * ccwl/cwl.scm (workflow->cwl-scm): Handle <cwl-workflow> objects. * tests/ccwl.scm ("read all forms of inputs and outputs from a CWL workflow"): New test. * guix.scm: Import (gnu packages guile-xyz) and (guix utils). (guile-libyaml): New variable. (ccwl)[inputs]: Add guile-libyaml.
2021-10-12tests: Fix quoting of type.Arun Isaac
* tests/ccwl.scm ("stdin input should not have inputBinding"): Fix quoting of type File.
2021-10-11ccwl: Factorize out CWL generation code to separate file.Arun Isaac
This factorization is required to support other compilation targets such as graphviz, bash, scheme, etc. * ccwl/cwl.scm: New file. * Makefile.am (SOURCES): Register it. * ccwl/ccwl.scm (ccwl): Export command?, command-inputs, command-outputs, command-args, command-stdin, command-other, workflow?, workflow-steps, workflow-inputs, workflow-outputs, workflow-other, input?, input-id, input-type, input-label, input-default, input-position, input-prefix, input-other, output?, output-id, output-type, output-binding, output-source, output-other, step?, step-id, step-run, step-in, step-out, unspecified-default?. (<workflow>): New type. (filter-alist): Move to cwl.scm. (make-workflow): Refactor into workflow->cwl-scm in cwl.scm. (output->cwl): Move to cwl.scm as output->cwl-scm. (command->cwl): Move to cwl.scm as command->cwl-scm. (workflow-steps): Rename to collect-steps. Clarify docstring. (workflow): Use collect-steps instead of workflow-steps. Explicitly pass empty list as other argument of make-workflow. Add TODO note to implement it properly. * scripts/ccwl.in: Import (ccwl cwl) instead of (ccwl yaml). Use workflow->cwl instead of scm->yaml. * tests/ccwl.scm ("stdin input should not have inputBinding"): Use command->cwl-scm from (ccwl cwl) instead of command->cwl from (ccwl ccwl).
2021-10-04ccwl: Support #:allow-other-keys in lambda** and syntax-lambda**.Arun Isaac
* ccwl/utils.scm (lambda**): Support #:allow-other-keys. Update docstring. (syntax-lambda**): Update docstring. * tests/utils.scm ("Allow other keys in lambda**", "Allow other keys in syntax-lambda**"): New tests.
2021-10-04ccwl: Error out on invalid keywords to lambda**.Arun Isaac
* ccwl/utils.scm (lambda**): Error out on invalid keywords (that is, keywords other than #:key, #:key* and #:allow-other-keys). * tests/utils.scm ("lambda** should error out on unrecognized keywords in arguments"): New test.
2021-10-04tests: Remove stray syntax-lambda** form.Arun Isaac
* tests/utils.scm: Remove stray syntax-lambda** form.
2021-07-27ccwl: Make syntax-lambda** more like lambda**.Arun Isaac
I have tripped up several times on the differences between lambda** and syntax-lambda**. No longer! Making syntax-lambda** as close as possible to lambda** makes the code much more readable and align better with common sense. * ccwl/utils.scm (syntax-lambda**): Do not ignore the first identifier. Accept multiple values as arguments, not a single syntax object. * ccwl/ccwl.scm (command): Update use of syntax-lambda**. * tests/utils.scm ("syntax-lambda**", "syntax-lambda** with default values"): Update tests.
2021-07-20ccwl: Set default value of lambda** n-ary arguments to '().Arun Isaac
* ccwl/utils.scm (lambda**): Set default value of lambda** n-ary arguments to the empty list. Document this in the docstring. * tests/utils.scm ("default value of lambda** unary argument should be #f", "default value of lambda** n-ary argument should be the empty list"): New tests.
2021-07-20ccwl: Document syntax-lambda** support for default arguments.Arun Isaac
* ccwl/utils.scm (syntax-lambda**): Add example to docstring documenting support for default arguments. * tests/utils.scm ("syntax-lambda** with default values"): New test.
2021-07-20ccwl: Support default values for arguments in lambda**.Arun Isaac
* ccwl/utils.scm (lambda**): Support default values for arguments, both unary and n-ary. * tests/utils.scm ("lambda** with default values"): New test.
2021-07-20tests: Add tests for ccwl/utils.scm.Arun Isaac
* tests/utils.scm: New file. * Makefile.am (SCM_TESTS): Register it.
2021-07-19tests: Fix order of arguments to test-equal.Arun Isaac
The expected value should be the first argument to test-equal. Getting this order wrong messes up the test logs. * tests/yaml.scm ("dictionary entries with empty arrays and dictionaries for values must render on the same line"): Fix order of arguments to test-equal.
2021-07-19tests: Fix indentation.Arun Isaac
* tests/ccwl.scm ("stdin input should not have inputBinding"): Fix indentation.
2021-07-02tests: Ensure stdin input has no inputBinding.Arun Isaac
* tests/ccwl.scm: Import (ccwl ccwl) ("stdin input should not have inputBinding"): New test.
2021-07-02tests: Remove unnecessary import.Arun Isaac
* tests/ccwl.scm: Do not import (srfi srfi-71).
2021-04-26Escape asterisk characters in scm->yaml.Arun Isaac
* ccwl/yaml.scm (display-atom): Escape asterisk characters. * tests/yaml.scm ("strings with asterisk characters should be escaped"): New test.
2021-04-26Test if scm->yaml escapes hyphen characters.Arun Isaac
* tests/yaml.scm ("strings with hyphen characters should be escaped"): New test.
2021-04-26Remove deprecated break-pair tests.Arun Isaac
* tests/ccwl.scm (break-pair): Delete function. ("break-pair", "break-pair: check last elemet handling"): Delete tests.
2021-04-17Add copyright section to test files.Arun Isaac
* tests/ccwl.scm, tests/yaml.scm: Add copyright section.
2021-02-27Add break-pair utility.Arun Isaac
* ccwl/ccwl.scm (break-pair): New function. * tests/ccwl.scm: New file. * tests/ccwl.scm ("break-pair", "break-pair: check last elemet handling"): New test cases.
2021-02-27Display dictionary entries with empty values on the same line.Arun Isaac
* ccwl/yaml.scm (display-dictionary-entry): If value is an empty array or dictionary, display it on the same line. (scm->yaml): Go to next line after printing empty array. * tests/yaml.scm: New file. * tests/yaml.scm ("dictionary entries with empty arrays and dictionaries for values must render on the same line"): New test case.