Added tests

This commit is contained in:
Dylan Araps
2018-06-14 19:21:41 +10:00
parent 51013c49c5
commit 4c52026a21
2 changed files with 33 additions and 9 deletions

View File

@@ -102,8 +102,8 @@ scripts and not full blown utilities.
### Trim leading and trailing white-space from string.
```sh
trim() {
# Usage: trim " example string "
trim_string() {
# Usage: trim_string " example string "
: "${1#"${1%%[![:space:]]*}"}"
: "${_%"${_##*[![:space:]]}"}"
printf '%s\n' "$_"
@@ -114,7 +114,7 @@ trim() {
```sh
# shellcheck disable=SC2086,SC2048
trim() {
trim_all() {
# Usage: trim " example string "
set -f
set -- $*