Commit Graph

28 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 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 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 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 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 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 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 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 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 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 1bd92e2893 Remove (almost) all references to Geesh.
gash/environment.scm: Remove file.
geesh/*: Move these files into the 'gash' folder and replace all
instances of the word 'geesh'.
scripts/geesh.in: Remove file.
HACKING, INSTALL, Makefile.am, configure.ac, guix.scm,
tests/bootstrap/bash-without-bash.scm, tests/spec/Makefile.am,
tests/spec/check-spec, tests/spec/oil.scm, tests/unit/*,
tools/coverage.in: Replace all instances of the word 'geesh'.

Co-authored-by: Jan Nieuwenhuizen <janneke@gnu.org>
2019-05-20 01:17:40 -04:00
Timothy Sample 6a68c73a7b Enable a test from the redirect spec. tests
* tests/spec/oil.scm: Enable a redirect test that requires errexit.
2018-12-05 16:08:09 -05:00
Timothy Sample 0ec3ed02a0 Enable the errexit specification test
* tests/spec/Makefile.am (TESTS): Add errexit.
* tests/spec/oil.scm: Filter and modify five of its tests.
2018-12-05 16:08:09 -05:00
Timothy Sample af75931948 Process options passed to the set built-in
* geesh/built-ins/set.scm (option?): New function.
(option-letter?): New function.
(set-option!): New function.
(main): Set or print options as specified by the given arguments.
* tests/spec/oil.scm: Filter out a redirect test that was only passing
because set did not work.
2018-12-05 16:08:09 -05:00
Timothy Sample dd64f22361 Enable 'loop' specification test
* tests/spec/Makefile.am (TESTS): Add 'loop'.
* tests/spec/oil.scm: Remove one test and patch four others.
2018-12-05 16:08:09 -05:00
Timothy Sample a5a1f85aa7 Enable 'case_' specification test
* tests/spec/Makefile.am (TESTS): Add 'case_'.
* tests/spec/oil.scm: Filter out two Bash-specific tests.
2018-12-05 16:08:09 -05:00
Timothy Sample da71aed3e3 Enable 'var-sub' specification test
* tests/spec/Makefile.am (TESTS): Add 'var-sub'.
* tests/spec/oil.scm: Patch three of its tests.
2018-12-05 16:08:09 -05:00
Timothy Sample 420ade9658 Enable 'quote' specification test
* tests/spec/Makefile.am (TESTS): Add 'quote'.
* tests/spec/oil.scm: Patch two of its tests and filter out six
others.
2018-12-05 16:08:09 -05:00
Timothy Sample f33669e636 Remove the BusyBox shell from specification tests
* tests/spec/oil.scm: Patch the test suite script to prevent it from
trying to run the BusyBox shell.
2018-12-05 16:08:09 -05:00
Timothy Sample 6805fc37b4 Patch and enable some specification tests
* tests/spec/oil.scm: Patch and enable five tests that were only
failing due to trivialities.
2018-12-05 16:08:09 -05:00
Timothy Sample 8fe509359d Add specification test patching
Sometimes we need to make minor changes to the tests to make them work
for us.  This patch enables doing search and replace on a test-by-test
basis.

* tests/spec/oil.scm: Allow for tests to be modified.
2018-12-05 16:08:09 -05:00
Timothy Sample ab30ebd14e Enable 'redirect' specification test
* tests/spec/Makefile.am (TESTS): Add 'redirect'.
* tests/spec/oil.scm: Filter out nine tests from it.
2018-12-05 16:08:09 -05:00
Timothy Sample 4cff559d1f Fix another shebang in Oil build script
* tests/spec/oil.scm: Add 'spec/bin/printenv.py' to the list of files
that get passed to 'patch-shebang'.
2018-12-05 16:08:09 -05:00
Timothy Sample 9dbf64d740 Enable 'word-split' specification test
* tests/spec/Makefile.am (TESTS): Add 'word-split'.
* tests/spec/oil.scm: Filter out four tests from it that we cannot
support yet.
2018-12-05 16:08:09 -05:00
Timothy Sample f448a57a27 Add filtering for specification tests
* tests/spec/oil.scm: Add code to filter out specific test cases from
a test file.
2018-12-05 16:08:09 -05:00
Timothy Sample f84b6235db Add Oil shell specification tests
tests/spec/oil.scm: New file.
tests/spec/check-spec: New file.
tests/spec/Makefile.am: New file.
configure.ac: Add the new Makefile.
Makefile.am (check-spec): New rule for running Oil shell
specification tests.
(clean-local): New rule that tells Automake how to clean up the
specification tests.
.gitignore: Add tests/spec/oil and tests/spec/oil-link.
2018-12-05 16:06:14 -05:00