mirror of
https://github.com/DictXiong/dotfiles.git
synced 2025-07-08 01:50:29 +08:00
ci: test common.sh getopts
This commit is contained in:
parent
be3f999a5d
commit
b62207db4d
14
tools/test-getopts.sh
Executable file
14
tools/test-getopts.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
OPTS="-a -bcl --color --arg1=1 --arg2 2 yes"
|
||||
TARGET_OPTS="-a -b -c --arg1 1 --arg2 2 yes"
|
||||
set -- $OPTS
|
||||
|
||||
THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
|
||||
source "$THIS_DIR/common.sh"
|
||||
|
||||
test "${GOT_OPTS[*]}" = "$TARGET_OPTS"
|
||||
test "$*" = "$OPTS"
|
||||
test "$DFS_LITE" = "1"
|
||||
is_tty
|
||||
test -z "$DFS_QUIET"
|
@ -23,6 +23,7 @@ test ~ -ef "$(pwd)"
|
||||
dogo
|
||||
doll
|
||||
dfs cd
|
||||
./tools/test-getopts.sh
|
||||
tools/common.sh get_os_type
|
||||
tools/common.sh get_linux_dist
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user