aboutsummaryrefslogtreecommitdiff
path: root/bin/sh/tests/parser
Commit message (Collapse)AuthorAgeFilesLines
* sh: Implement simple parameter expansion in PS1 and PS2Matthew Phillips2025-11-077-0/+56
| | | | | | | | | | This change follows a localized approach within getprompt() and avoids full parser reentry. While this means we don't support advanced expansions like ${parameter#pattern}, it provides POSIX-compliant basic parameter expansion without the complexity of making the parser reentrant. This is sufficient for the vast majority of use cases. PR: 46441
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-1682-82/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* sh: Fix heredoc at certain places in case and forJilles Tjoelker2021-10-274-0/+28
| | | | | | | | After an unescaped newline, there may be a here-document. Some places in case and for did not check for one. Reviewed by: bdrewery Differential Revision: https://reviews.freebsd.org/D32628
* sh/tests: Test some obscure cases with aliasing keywordsJilles Tjoelker2020-05-125-0/+21
| | | | Notes: svn path=/head/; revision=360992
* sh: Test that backslash-newline within single-quotes is not specialJilles Tjoelker2018-05-112-0/+6
| | | | | | | This works correctly, but the test may be helpful when modifying the parser. Notes: svn path=/head/; revision=333507
* sh: Fix use after free when resetting an in-use alias.Jilles Tjoelker2017-04-162-0/+9
| | | | | | | | | The special case of modifying an existing alias does not work correctly if the alias is currently in use. Instead, handle this case by unaliasing the old alias (if any) and then creating a new alias. Notes: svn path=/head/; revision=317039
* sh: Link the new test to the build.Jilles Tjoelker2017-04-161-0/+1
| | | | Notes: svn path=/head/; revision=317038
* sh: Fix unalias -a while an alias is currently in use.Jilles Tjoelker2017-04-161-0/+7
| | | | | | | | It is a rare situation to modify aliases while an alias is currently in use, but this is handled for plain unalias. Handle it for unalias -a as well. Notes: svn path=/head/; revision=317037
* sh: Add test for unaliasing an alias that is currently in use.Jilles Tjoelker2017-04-082-0/+8
| | | | | | | This already works correctly. Notes: svn path=/head/; revision=316646
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedEnji Cooper2016-05-041-78/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=299094
* MFHGlen Barber2016-03-101-0/+11
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=296625
| * DIRDEPS_BUILD: Connect MK_TESTS.Bryan Drewery2016-03-091-0/+11
| | | | | | | | | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=296587
* | MFHGlen Barber2016-02-243-0/+14
|\| | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295957
| * sh: Fix set -v and multiline history after r295825.Jilles Tjoelker2016-02-233-0/+14
| | | | | | | | | | | | | | | | | | | | r295825 erroneously dropped the newline from the input data for 'set -v' output and multiline history. Reported by: vangyzen Notes: svn path=/head/; revision=295937
* | MFHGlen Barber2016-02-224-0/+22
|\| | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295886
| * sh: Rework code to remove '\0' from shell input.Jilles Tjoelker2016-02-192-0/+13
| | | | | | | | | | | | | | | | This fixes bugs where '\0' was not removed correctly and speeds up the parser. Notes: svn path=/head/; revision=295825
| * sh: Add tests for comments in sh -c.Jilles Tjoelker2016-02-193-0/+9
| | | | | | | | Notes: svn path=/head/; revision=295818
* | Fix build.Glen Barber2016-02-031-1/+0
| | | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295215
* | First pass to fix the 'tests' packages.Glen Barber2016-02-021-0/+4
|/ | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295171
* sh: Allow empty << EOF markers.Jilles Tjoelker2015-09-022-0/+22
| | | | Notes: svn path=/head/; revision=287408
* sh: Avoid negative character values from $'\Uffffffff' etc.Jilles Tjoelker2015-08-202-0/+9
| | | | | | | | | | | | The negative value was not expected and generated the low 8 bits as a byte, which may be an invalid character encoding. The final shift in creating the negative value was undefined as well. Make the temporary variable unsigned to fix this. Notes: svn path=/head/; revision=286973
* sh: Add test for $'\u' without any digits.Jilles Tjoelker2015-08-202-0/+8
| | | | | | | | It is likely that $'\uXXXX' and $'\UXXXXXXXX' will allow fewer digits in future. However, no digits at all should still be disallowed. Notes: svn path=/head/; revision=286971
* sh: Allow backslash-newline continuation in more places:Jilles Tjoelker2014-10-199-0/+113
| | | | | | | | | | * directly after a $ * directly after ${ * between the characters of a multi-character operator token * within a parameter name Notes: svn path=/head/; revision=273276
* sh: Add some tests for backslash-newline continuation.Jilles Tjoelker2014-10-174-0/+30
| | | | Notes: svn path=/head/; revision=273243
* sh: Remove arbitrary length limit on << EOF markers.Jilles Tjoelker2014-09-142-0/+48
| | | | | | | This also simplifies the code. Notes: svn path=/head/; revision=271593
* Convert bin/sh/tests to ATFEnji Cooper2014-08-131-3/+5
| | | | | | | | | | | | | | | | The new code uses a "test discovery mechanism" to determine what tests are available for execution The test shell can be specified via: kyua test -v test_suites.FreeBSD.bin.sh.test_shell=/path/to/test/sh Sponsored by: EMC / Isilon Storage Division Approved by: jmmv (mentor) Reviewed by: jilles (maintainer) Notes: svn path=/head/; revision=269902
* sh: Allow aliases to force alias substitution on the following word.Jilles Tjoelker2014-01-264-0/+24
| | | | | | | | | | | If an alias's value ends with a space or tab, the next word is also checked for aliases. This is a POSIX feature. It is useful with utilities like command and nohup (alias them to themselves followed by a space). Notes: svn path=/head/; revision=261192
* sh: Add tests for alias names after another alias.Jilles Tjoelker2014-01-253-0/+14
| | | | | | | | Since the first alias's value does not end with a blank, the next word should not be checked for aliases. Notes: svn path=/head/; revision=261160
* sh: Do not depend on parse/execute split in new alias test.Jilles Tjoelker2014-01-241-1/+1
| | | | Notes: svn path=/head/; revision=261141
* sh: Add test for nested alias.Jilles Tjoelker2014-01-242-0/+7
| | | | Notes: svn path=/head/; revision=261121
* Migrate tools/regression/bin/ tests to the new layout.Julio Merino2013-12-1151-0/+836
This change is a proof of concept on how to easily integrate existing tests from the tools/regression/ hierarchy into the /usr/tests/ test suite and on how to adapt them to the new layout for src. To achieve these goals, this change: - Moves tests from tools/regression/bin/<tool>/ to bin/<tool>/tests/. - Renames the previous regress.sh files to legacy_test.sh. - Adds Makefiles to build and install the tests and all their supporting data files into /usr/tests/bin/. - Plugs the legacy_test test programs into the test suite using the new TAP backend for Kyua (appearing in 0.8) so that the code of the test programs does not have to change. - Registers the new directories in the BSD.test.dist mtree file. Reviewed by: freebsd-testing Approved by: rpaulo (mentor) Notes: svn path=/head/; revision=259210