Commit Graph

132 Commits

Author SHA1 Message Date
Timothy Sample 87229e4b3a Add arithmetic expansion.
* gash/arithmetic.scm: New file.
* Makefile.am (SOURCES): Add it.
* gash/lexer.scm (get-arithmetic-expansion): New procedure.
(get-expansion): Check for "$((" and use the new procedure to read an
arithmetic expansion.
* gash/eval.scm (word->qword): Handle '<sh-arithmetic>'.
* tests/unit/eval.scm: Add tests.
* tests/spec/Makefile.am (TESTS): Add 'arith'.
* tests/spec/oil.scm: Patch seven of its tests and filter out fifteen
others.
* doc/gash.texi, doc/syntax.txt: Add '<sh-arithmetic>' syntax.
2021-05-26 13:16:50 -04:00
Timothy Sample d3244e0ec0 Move evaluation code from 'word' to 'eval'.
This adjustment paves the way for writing a compiler.

* gash/word.scm (eval-cmd-sub, string-not-null?, word->qword,
expand-word): Move these...
* gash/eval.scm: ...to this module.
* tests/unit/word.scm: Adjust qword tests to use 'expand-qword', and
move non-qword (evaluation) tests to...
* tests/unit/eval.scm: ...this new file, adjusting them to use
'eval-word'.
* Makefile.am (UNIT_TESTS): Add the new file.
2021-04-19 15:11:27 -04:00
Timothy Sample f22bc57996 Respect noclobber when redirecting.
* gash/shell.scm (process-redir): Respect the noclobber option.
* tests/redirects.org: Add a test.
2020-03-22 11:57:17 -04:00
Timothy Sample 25cd5ac5af Use the configured system shell in tests.
* Makefile.am (AM_TESTS_ENVIRONMENT): New variable.
* tests/redirects.org (Files opened for redirect can be executed
immediately): Use an environment variable instead of hard-coding
'/bin/sh'.
2020-02-06 20:26:57 -05:00
Timothy Sample b7c2153785 Make the bootstrap test work with current Guix.
* tests/bootstrap/bash-without-bash.scm (%boot0-inputs): Call the
upstream '%boot0-inputs' to get the list of packages.
2019-12-15 21:56:31 -05:00
Jan Nieuwenhuizen 7eacf52807 Test executing redirect-created files immediately.
* tests/redirects.org (Files opened for redirect can be executed
immediately): New test.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-12-09 13:36:41 -05:00
Timothy Sample 22205a00a3 Enable 'glob' specification test
* tests/spec/Makefile.am (TESTS): Add 'glob'.
* tests/spec/oil.scm: Patch one of its tests and filter out eleven
others.
2019-12-09 13:36:41 -05:00
Timothy Sample 3d3375e066 Fix pathname expansion.
The old implementation had several bugs, prompting this complete
rewrite.

* gash/compat/srfi-43.scm (vector-empty?): New procedure.
* gash/pattern.scm (pattern-null?): New procedure.
* gash/word.scm (qword->pattern-string): New procedure.
(qword->pattern): Rewrite using 'qword->pattern-string'.
(find-files): New procedure.
(expand-pathnames): Rewrite using 'find-files' and add a docstring.
* tests/unit/word.scm: Add tests.
(mock): New syntax.
(make-pure-scandir): New procedure.
(with-mocked-files): New syntax.
2019-12-09 13:23:54 -05:00
Timothy Sample cf6a886f61 Swap semantics of ':+' and '+'.
These were mixed up, with ':+' behaving like '+' and vice versa.

* gash/word.scm (word->qword): Swap implementations of '<sh-ref-and>'
and '<sh-ref-and*>'.
* tests/unit/word.scm: Swap tests.
2019-12-09 13:04:20 -05:00
Timothy Sample 4acbd303a9 Enable 'command-sub' specification test
* tests/spec/Makefile.am (TESTS): Add 'command-sub'.
* tests/spec/oil.scm: Patch four of its tests and filter out another.
2019-12-09 13:04:20 -05:00
Timothy Sample 66685b6219 Add test for backquoted commands in heredocs.
* tests/unit/parser.scm: Add test.
2019-12-09 13:04:20 -05:00
Timothy Sample 7deaa94bd5 Correctly parse double-quoted backquoted commands.
* gash/lexer.scm (read-backquoted-command): Make the default procedure
accept a 'quoted?' keyword.
(get-backquoted-command): Accept a 'quoted?' keyword and pass it on to
'read-backquoted-command'.
(get-expansion): Accept a 'quoted?' keyword and pass it on to
'get-backquoted-command'.
(get-double-quotation): Set the 'quoted?' keyword when calling
'get-expansion'.
* tests/unit/lexer.scm: Add tests.
* gash/parser.scm (call-with-backquoted-input-port): Accept a
'quoted?' keyword which, if set, adds the double quote character to
the set of escapable characters.
(read-sh/backquoted): Accept a 'quoted?' keyword and pass it on to
'call-with-backquoted-input-port'.
* tests/unit/parser.scm: Add tests.
2019-12-09 13:04:18 -05:00
Timothy Sample 8135e19904 Implement asserting references.
* gash/word.scm (word->qword): Add an implementation for the
'<sh-ref-assert>' and '<sh-ref-assert*>' cases.
* tests/variable-operators.org: New file.
* Makefile.am (FULL_TESTS): Add it.
2019-12-08 12:18:31 -05:00
Timothy Sample 7fee72f5c7 Reset exit status on assignment.
* gash/eval.scm (eval-word): Add 'on-command-substitution' keyword.
(eval-sh): On '<sh-set!>' reset the exit status unless a command
substitution has occurred.
* tests/assignments.org: Add tests.
2019-12-08 12:18:31 -05:00
Timothy Sample 804b6cbe05 Make 'read' handle logical lines.
* gash/built-ins/read.scm (read-logical-line): New procedure.
(main): Use it unless given the '-r' option.
* tests/read.org: Add tests.
2019-12-08 12:18:31 -05:00
Timothy Sample 5fed1b0d87 Make 'read' handle input field splitting.
* gash/built-ins/read.scm (split-fields): New procedure.
(main): Use it to split the input into fields and assign each field to
its corresponding variable.
* tests/read.org: New file.
* Makefile.am (FULL_TESTS): Add it.
2019-12-08 12:18:18 -05:00
Timothy Sample 7a0f4fbae2 Handle nested lists when removing quotes.
* gash/word.scm (remove-quotes): Handle nested lists.
(split-fields) <wedge-apart-quote>: Likewise.
* tests/unit/word.scm: Add test.
2019-11-24 17:40:05 -05:00
Timothy Sample 16ba8ca016 Use temporary assignments when calling functions.
* gash/environment.scm (save-variables-excursion): New procedure.
* gash/shell.scm (sh:exec-let): Use it to set up temporary assignments
during the extent of a function.
* tests/temporary-assignments.org: New file.
* Makefile.am (TESTS): Add it.
2019-11-24 17:13:54 -05:00
Timothy Sample b41ae32106 Delay bracket expression errors in patterns.
* gash/pattern.scm (parse-matching-bracket-expression): Do not
report errors until a full bracket expression has been parsed.
* tests/unit/pattern.scm: Add test.
2019-11-24 17:13:54 -05:00
Timothy Sample 5450e19094 Enable 'var-op-strip' specification test
* tests/spec/Makefile.am (TESTS): Add 'var-op-strip'.
* tests/spec/oil.scm: Patch two of its tests and filter out four
others.
2019-11-24 17:13:54 -05:00
Timothy Sample 1b41a34ce2 Use UTF-8 when processing specification tests.
* tests/spec/oil.scm: Set the encoding on the input and output ports
to UTF-8.
2019-11-24 17:13:54 -05:00
Timothy Sample 223e8d2635 Remove tests for the '/' variable operator.
This is a Bash-specific feature, which means that it is out of scope
for now.

* tests/variable-patterns.org (slash, slash-string,
slash-string-slash): Delete tests.
2019-11-24 17:13:54 -05:00
Timothy Sample e029c4cbab Add pattern dropping procedures.
* gash/pattern.scm (string-contains-part-right): New procedure.
(pattern-drop): New procedure.
(pattern-drop-right): New procedure.
* tests/unit/pattern.scm: Test the dropping procedures.
2019-11-24 17:13:54 -05:00
Timothy Sample a009118efb Add tests for 'pattern-plain?'.
* tests/unit/pattern.scm: Add tests for 'pattern-plain?'.
2019-11-24 17:13:54 -05:00
Timothy Sample dd215ee926 Do not test Bash with the specification tests.
* tests/spec/oil.scm: Disable testing Bash in 'spec.sh'.
2019-11-24 17:13:54 -05:00
Timothy Sample 0b49934a0b Remove extra import from 'run-test-suite'.
The '(ice-9 textual-ports)' module is not needed, and using it breaks
the test suite on Guile 2.0.

* tests/run-test-suite.in: Do not use '(ice-9 textual-ports)'.
2019-08-20 11:38:11 -04:00
Timothy Sample d9122d7b68 Use 'sh:exit' for 'errexit'.
* gash/shell.scm (errexit): Exit using 'sh:exit'.
* tests/unit/shell.scm: Make sure exit handlers are called on
'errexit'.
2019-08-01 09:12:35 -04:00
Timothy Sample da9a05d500 Do not use 'with-continuation-barrier'.
It turns out that 'with-continuation-barrier' allows delimited
continuations (i.e., prompts) to get through.

* gash/shell.scm (%subshell): Replace 'with-continuation-barrier' with
'dynamic-wind', making sure to preserve exit statuses that were leaked
through before.
* tests/unit/shell.scm (call-with-temporary-directory): Replace
'with-continuation-barrier' with 'dynamic-wind'.
* tests/spec/oil.scm: Enable previously failing tests.
2019-08-01 09:10:38 -04:00
Timothy Sample 6228064801 Fix top-level 'break', 'continue', and 'return'.
* gash/environment.scm (sh:break, sh:continue, sh:return): Wrap
'abort-to-prompt' with 'false-if-exception'.
* gash/built-ins/break.scm (main): Print warning and continue if
'sh:break' returns.
* gash/built-ins/continue.scm (main): Likewise, but for 'sh:continue'.
* gash/built-ins/return.scm (main): Likewise, but for 'sh:return'.
* tests/functions.org (Top-level return): New test.
* tests/spec/oil.scm: Enable previously failing test.
2019-08-01 09:02:05 -04:00
Timothy Sample 150c6eac53 Handle 'return' errors.
* gash/built-ins/utils.scm (string->exit-status): New procedure.
* gash/built-ins/return.scm (main): Use it to simplify argument
checking; check for too many arguments; and print messages on
errors.
* tests/functions.org (Too many arguments to return): New test.
2019-06-14 20:58:23 -04:00
Timothy Sample ffe9fc1f47 Handle 'break' and 'continue' errors.
* gash/built-ins/utils.scm (string->positive-integer): New function.
* gash/built-ins/break.scm (main): Use it to simplify argument
checking; check for too many arguments; and print messages on errors.
* gash/built-ins/continue.scm (main): Ditto.
* gash/shell.scm (sh:exec-let): Throw an error if a special built-in
fails.
* tests/spec/oil.scm: Enable and adjust previously failing tests.
2019-06-14 20:46:57 -04:00
Timothy Sample 7d2298d15b Aggregate tests into test suites.
This is a big change, but it is conceptually quite simple.  In the old
system, the tests were specified each by multiple files ('.sh', '.exit',
'.stdout', and '.stderr'), and run with the 'test.sh' script.  In the
new system there are multiple tests per file ('.org') and these test
suite files are run with the 'tests/run-test-suite' script.

* tests/00-exit-0.sh,
tests/00-exit-1.exit,
tests/00-exit-1.sh,
tests/00-exit-2.exit,
tests/00-exit-2.sh,
tests/00-exit-error.exit,
tests/00-exit-error.sh,
tests/00-exit-var.exit,
tests/00-exit-var.sh,
tests/00-exit.sh: Delete files, moving their contents...
* tests/exiting.org: ...here.
* tests/01-script-arg-0.sh,
tests/01-script-arg-length.sh,
tests/01-script-arg-length.stdout,
tests/01-script-arg-list.sh,
tests/01-script-arg-list.stdout,
tests/01-script-backslash-space.sh,
tests/01-script-backslash-twice.exit,
tests/01-script-backslash-twice.sh,
tests/01-script-backslash.exit,
tests/01-script-backslash.sh,
tests/01-script-newline.exit,
tests/01-script-newline.sh,
tests/01-script-semi.exit,
tests/01-script-semi.sh,
tests/01-script-shift.sh,
tests/01-script-shift.stdout: Delete files, moving their contents...
* tests/arguments.org: ...here.
* tests/03-echo-brace.sh,
tests/03-echo-brace.stdout,
tests/03-echo-doublequotes.sh,
tests/03-echo-doublequotes.stdout,
tests/03-echo-escaped-doublequotes.sh,
tests/03-echo-escaped-doublequotes.stdout,
tests/03-echo-nesting.sh,
tests/03-echo-nesting.stdout,
tests/03-echo-quoted-doublequotes.sh,
tests/03-echo-quoted-doublequotes.stdout,
tests/03-echo.sh: Delete files, moving their contents...
* tests/words.org: ...here.
* tests/04-echo-equal.sh,
tests/04-echo-equal.stdout,
tests/04-echo-var.sh,
tests/04-echo-word-at-word.sh,
tests/04-echo-word-at-word.stdout,
tests/04-echo-word-at.sh,
tests/04-echo-word-at.stdout: Delete files, moving their contents...
* tests/variable-words.org: ...here.
* tests/05-assignment-backtick.sh,
tests/05-assignment-backtick.stdout,
tests/05-assignment-double-quote.sh,
tests/05-assignment-doublequoted-doublequotes.sh,
tests/05-assignment-doublequoted-doublequotes.stdout,
tests/05-assignment-echo.sh,
tests/05-assignment-echo.stdout,
tests/05-assignment-empty.sh,
tests/05-assignment-empty.stdout,
tests/05-assignment-singlequote.sh,
tests/05-assignment-variable-word.sh,
tests/05-assignment-variable-word.stdout,
tests/05-assignment-word-variable.sh,
tests/05-assignment-word-variable.stdout,
tests/05-assignment.sh: Delete files, moving their contents...
* tests/assignments.org: ...here.
* tests/06-command-compound-word.sh,
tests/06-command-compound-word.stdout,
tests/06-compound-word.sh,
tests/06-compound-word.stdout: Delete files, moving their contents...
* tests/compound-words.org: ...here.
* tests/07-variable-not-or.sh,
tests/07-variable-not-or.stdout,
tests/07-variable-or-doublequote.sh,
tests/07-variable-or-doublequote.stdout,
tests/07-variable-or-empty.sh,
tests/07-variable-or-empty.stdout,
tests/07-variable-or-slash.sh,
tests/07-variable-or-variable.sh,
tests/07-variable-or-variable.stdout,
tests/07-variable-or.sh,
tests/07-variable-or.stdout: Delete files, moving their contents...
* tests/variable-or.org: ...here.
* tests/08-variable-and.sh,
tests/08-variable-and.stdout,
tests/08-variable-not-and.sh,
tests/08-variable-not-and.stdout: Delete files, moving their contents...
* tests/variable-and.org: ...here.
* tests/10-else-multiple.sh,
tests/10-else.multiple.stdout,
tests/10-if-bracket-false.sh,
tests/10-if-bracket.sh,
tests/10-if-elif.sh,
tests/10-if-else.sh,
tests/10-if-false.sh,
tests/10-if-line.sh,
tests/10-if-multiple.sh,
tests/10-if-multiple.stdout,
tests/10-if-redirect.sh,
tests/10-if-test-false.sh,
tests/10-if-test.sh,
tests/10-if-word-variable.sh,
tests/10-if.sh: Delete files, moving their contents...
* tests/conditionals.org: ...here.
* tests/11-for-done-subshell.sh,
tests/11-for-done-subshell.stdout,
tests/11-for-split-sequence.sh,
tests/11-for-split-sequence.stdout,
tests/11-for.sh,
tests/11-for.stdout: Delete files, moving their contents...
* tests/loops.org: ...here.
* tests/20-and.exit,
tests/20-and.sh,
tests/20-exec.sh,
tests/20-or.sh,
tests/20-pipe-exit-0.sh,
tests/20-pipe-exit-1.exit,
tests/20-pipe-exit-1.sh,
tests/20-pipe-sed-cat.sh,
tests/20-pipe-sed-cat.stdout,
tests/20-pipe-sed.sh,
tests/20-pipe-sed.stdout,
tests/20-semi.exit,
tests/20-semi.sh: Delete files, moving their contents...
* tests/pipes-and-booleans.org: ...here.
* tests/30-for-substitution.sh,
tests/30-for-substitution.stdout,
tests/30-substitution-assignment-at.sh,
tests/30-substitution-assignment-at.stdout,
tests/30-substitution-assignment.sh,
tests/30-substitution-assignment.stdout,
tests/30-substitution-backtick.sh,
tests/30-substitution-backtick.stdout,
tests/30-substitution-redirect.sh,
tests/30-substitution-redirect.stdout,
tests/30-substitution-word.sh,
tests/30-substitution-word.stdout,
tests/30-substitution.sh,
tests/30-substitution.stdout: Delete files, moving their contents...
* tests/command-substitution.org: ...here.
* tests/40-assignment-eval-echo.sh,
tests/40-assignment-eval-echo.stdout,
tests/40-eval-echo-variable.sh,
tests/40-eval-echo-variable.stdout,
tests/40-eval.sh,
tests/40-eval.stdout: Delete files, moving their contents...
* tests/eval.org: ...here.
* tests/41-dot.sh,
tests/41-dot.stdout: Delete files, moving their contents...
* tests/dot.org: ...here.
* tests/42-export-new.sh,
tests/42-export-new.stdout,
tests/42-sh-export-new.sh,
tests/42-sh-export-new.stdout,
tests/42-sh-export.sh,
tests/42-sh-export.stdout,
tests/42-sh.sh,
tests/42-sh.stdout: Delete files, moving their contents...
* tests/exporting.org: ...here.
* tests/data/42-export-new.sh: New file (copied from
'tests/42-export-new.sh').
* tests/43-trap-subshell.sh,
tests/43-trap-subshell.stdout: Delete files, moving their contents...
* tests/signals.org: ...here.
* tests/50-iohere-builtin.sh,
tests/50-iohere.sh,
tests/50-iohere.stdout,
tests/50-redirect-append.sh,
tests/50-redirect-append.stdout,
tests/50-redirect-clobber.sh,
tests/50-redirect-clobber.stdout,
tests/50-redirect-in-out.sh,
tests/50-redirect-in-out.stdout,
tests/50-redirect-in.sh,
tests/50-redirect-merge.sh,
tests/50-redirect-merge.stdout,
tests/50-redirect-pipe.sh,
tests/50-redirect-pipe.stdout,
tests/50-redirect-sed.sh,
tests/50-redirect-sed.stdout,
tests/50-redirect-space.sh,
tests/50-redirect-space.stdout,
tests/50-redirect.sh,
tests/50-redirect.stdout: Delete files, moving their contents...
* tests/redirects.org: ...here.
* tests/60-function-at.sh,
tests/60-function-at.stdout,
tests/60-function.sh,
tests/60-function.stdout,
tests/60-subst.sh: Delete files, moving their contents...
* tests/functions.org: ...here.
* tests/70-hash-hash.sh,
tests/70-hash-hash.stdout,
tests/70-hash.sh,
tests/70-hash.stdout,
tests/70-percent-percent.sh,
tests/70-percent-percent.stdout,
tests/70-percent-space.sh,
tests/70-percent-space.stdout,
tests/70-percent.sh,
tests/70-percent.stdout,
tests/70-slash-string-slash.sh,
tests/70-slash-string.sh,
tests/70-slash-string.stdout,
tests/70-slash.sh,
tests/70-slash.stdout: Delete files, moving their contents...
* tests/variable-patterns.org: ...here.
* tests/100-bracket-file.sh,
tests/100-cd-foo.exit,
tests/100-cd-foo.sh,
tests/100-cd.sh,
tests/100-cd.stdout,
tests/100-test-false.sh,
tests/100-test-file.sh,
tests/100-test.sh: Delete files.
* tests/README: Move this...
* tests/data/README: ...here and adapt to the new directory.
* test.sh: Delete file.
* tests/run-test-suite.in: New file.
* configure.ac: Configure it.
* Makefile.am (TEST_EXTENSIONS): Replace '.sh' with '.org'.
(SH_LOG_COMPILER): Delete variable.
(ORG_LOG_COMPILER): New variable.
(FULL_TESTS, XFAIL_TESTS): Replace '.sh' tests with '.org' tests.
(BROKEN_TESTS): Delete variable.
(TEST_DATA_FILES): Remove '.exit' and '.stdout' files; add
tests/data/42-export-new.sh.
(EXTRA_DIST): Add tests/data/README; remove tests/README,
BROKEN_TESTS, and test.sh.
* .gitignore: Adjust accordingly.
2019-06-14 20:27:33 -04:00
Timothy Sample 375752301c Update the specification tests.
* tests/spec/oil.scm: Update to the latest commit and filter out some
new failing tests.
2019-06-07 10:01:42 -04:00
Timothy Sample 27df6180c3 Remove extra '<sh-begin>' wrappers.
This commit fixes many differences between the parser output and the
syntax document.

* gash/parser.scm (make-parser): Only wrap a command list with
'<sh-begin>' when necessary.
* tests/unit/parser.scm: Update tests accordingly.
2019-05-26 20:37:53 -04:00
Timothy Sample 490878443b Further clarify test copyrights.
* tests/COPYRIGHT: Rename this...
* tests/README: ...to this and make it much more explicit.
* Makefile.am (EXTRA_DIST): Update name.
2019-05-24 14:15:22 -04:00
Timothy Sample 2fe190e497 Clarify the copyrights of the integration tests.
* tests/COPYRIGHT: New file.
* Makefile.am (EXTRA_DIST): Add it.
2019-05-22 00:44:39 -04:00
Timothy Sample 597a6bcfb1 Touch up metadata and copyright notices.
* build-aux/gitlab-ci.yml,
build-aux/pre-inst-env.in,
configure.ac,
test.sh,
tests/spec/Makefile.am,
tests/spec/check-spec: Add copyright notices and GPLv3+ license notice.
* guix.scm: Add a "special exception" permissive license notice.
* doc/syntax.txt: Add title, introduction, copyright notice, and a
simple all-permissive license.
* COPYING.CC0: New file.
* NEWS: Reformat and add CC0 license notice.
* README: Add CC0 license notice.
* Makefile.am: Add copyright notices and GPLv3+ license notice.
(EXTRA_DIST): Add COPYING.CC0.
2019-05-22 00:44:39 -04:00
Timothy Sample 95545c9269 Fix building from an external directory.
* Makefile.am (scripts/gash): Make sure the 'scripts' directory exists
in the build tree.
(SH_LOG_COMPILER): Call 'test.sh' from the source tree.
* test.sh: Change the default test shell from 'scripts/gash' to
'gash'; export a 'TEST_TMP' variable that tells tests where to store
temporary files; and make sure all output is written to the build
directory.
tests/50-redirect-append.sh: Use the 'TEST_TMP' variable.
tests/60-subst.sh: Ditto.
2019-05-20 18:07:47 -04:00
Timothy Sample 38c832a8e2 Add missing copyright headers.
* gash/pattern.scm,
gash/shell.scm,
tests/bootstrap/bash-without-bash.scm,
tests/spec/oil.scm,
tests/unit/config.scm.in: Add missing copyright header.
2019-05-20 18:07:47 -04:00
Timothy Sample 2d46b8b43e Move 'setvbuf' shim to '(gash compat)'.
* tests/unit/shell.scm: Mode 'setvbuf' shim...
* gash/compat.scm: ...here.
2019-05-20 18:07:47 -04:00
Timothy Sample 2d19d82444 Make the bootstrap test more realistic.
Instead of building regular Bash using regular Gash, we now build
minimal Bash using the bootstrap build inputs, with bootstrap Bash
replaced by bootstrap Gash.

* tests/bootstrap/bash-without-bash.scm (gash-with-links): Rename this...
(%bootstrap-gash): ...to this, and use nothing but the bootstrap Guile
to build and run it.
(%bootstrap-coreutils&co-without-bash): New variable.
(%bootstrap-coreutils&co?): New function.
(%boot0-inputs): New variable.
2019-05-20 18:07:47 -04:00
Timothy Sample 0c57fc9ef9 Move 'textual-ports' under 'compat'.
* gash/textual-ports.scm: Move this...
* gash/compat/textual-ports.scm: ...here.
* Makefile.am, gash/lexer.scm, gash/parser.scm, gash/shell.scm,
tests/unit/shell.scm: Update references.
2019-05-20 18:07:47 -04:00
Timothy Sample 878b9c3dca Add support for Guile 2.0.9.
* gash/compat.scm: New file.
* gash/compat/hash-table.scm: New file.
* Makefile.am: Add them.
* .dir-locals.scm: Add indentation for 'if-guile-version-below'.
* guix.scm (guile-2.0.9): New variable.
* gash/built-ins/echo.scm (escape->control): Use '#\esc'.
* gash/environment.scm: Use '(gash compat hash-table)'.
* gash/built-ins/break.scm,
gash/built-ins/cd.scm,
gash/built-ins/command.scm,
gash/built-ins/continue.scm,
gash/built-ins/dot.scm,
gash/built-ins/exec.scm,
gash/built-ins/exit.scm,
gash/built-ins/pwd.scm,
gash/built-ins/return.scm,
gash/built-ins/set.scm,
gash/built-ins/shift.scm,
gash/built-ins/trap.scm,
gash/built-ins/type.scm,
gash/built-ins/umask.scm,
gash/eval.scm,
tests/unit/automake.scm: Use '(gash compat)'.

squash! Add support for Guile 2.0.9.
2019-05-20 18:07:47 -04:00
Timothy Sample 7e65eae774 Remove extra shells from the spec tests.
* tests/spec/oil.scm: Patch out all reference shells from the test
suite expect for Bash.
2019-05-20 18:07:47 -04:00
Timothy Sample 6283a632ba Fix test data filename.
* tests/for-done-subshell.stdout: Rename this...
* tests/11-for-done-subshell.stdout: ...to this.
2019-05-20 18:07:47 -04:00
Timothy Sample 536319194f Delete unused test data.
* tests/data/basename.sed,
tests/data/fooRbar,
tests/data/ro.tar: Delete files.
2019-05-20 18:07:47 -04:00
Timothy Sample df43ca7215 Add support for Guile 2.0.
* configure.ac (GUILE_PKG): Add 2.0.
* gash/textual-ports.scm: New file.
* Makefile.am: Add it.
* gash/lexer.scm, gash/parser.scm, gash/shell.scm: Use it in place of
'(ice-9 textual-ports)'.
* tests/unit/shell.scm: Use it in place of '(ice-9 textual-ports)';
replace '(ice-9 textual-ports)' with '(rnrs io ports)' in sub-scripts;
and add a shim for 'setvbuf'.
2019-05-20 01:18:54 -04:00
Timothy Sample 9af8bb2832 Remove 'setvbuf' in string port redirect test.
This was only relevant to an older implementation of redirects, and
does not make much sense for us now.

* tests/unit/shell.scm (Redirects here-document to standard input):
Remove call to 'setvbuf'.
2019-05-20 01:18:54 -04:00
Jan Nieuwenhuizen 18aefdda18 tests: Add 100-test-false.sh.
* tests/100-test-false.sh: New file.
* Makefile.am (FULL_TESTS): Add it.
2019-05-20 01:18:48 -04:00
Jan Nieuwenhuizen 06099ddead tests: Add 43-trap-subshell.sh.
* tests/43-trap-subshell.sh: New file.
* tests/43-trap-subshell.stdout: New file.
* Makefile.am (FULL_TESTS): Add tests/43-trap-subshell.sh.
2019-05-20 01:18:48 -04:00