dotfiles/tools/test.zsh

62 lines
1.3 KiB
Bash
Raw Normal View History

#!/bin/false "This script should be sourced in zsh, not executed directly"
set -ex
# check files
cd /
l
cd ~
l
dfs cd
l
pwd
test -f .zshrc2
diff -q ./.ssh/authorized_keys2 ~/.ssh/authorized_keys2
grep -q ".zshrc2" ~/.zshrc
# check scripts and functions
dfs version
dfs log 1
dfs beacon gh.ci $GITHUB_SHA
z ~
test ~ -ef "$(pwd)"
dogo
doll
dfs cd
2023-01-08 15:33:09 +08:00
tools/test-getopts.sh
tools/common.sh get_os_name
test $(echo y | tools/common.sh ask_for_yN "test") = "1"
test $(echo n | tools/common.sh ask_for_yN "test") = "0"
test $(echo | tools/common.sh ask_for_yN "test") = "0"
test $(echo | tools/common.sh ask_for_Yn "test") = "1"
test $(DFS_QUIET=1 tools/common.sh ask_for_Yn "test") = "1"
# check alias
alias p114
which riot
2023-01-30 19:41:00 +08:00
sagent
2023-01-30 19:46:27 +08:00
test -f "/tmp/piv-agent-$(whoami)"
gbes || which gbes
# check update
DFS_VERSION=`dfs version`
dfs update
dfs version
test `git rev-parse HEAD` = `curl -fsSL https://api.beardic.cn/get-var/dfs-commit-id`
# clean
git reset --hard $DFS_VERSION
# then check install.sh
2023-02-01 17:08:56 +08:00
./install.sh -dx DFS_CI=1 -H e153a2eL,f8At3iFw
2023-02-01 21:16:29 +08:00
grep -qE "testhist 1$" ~/.zsh_history
grep -qE "testhist 4$" ~/.zsh_history
2023-02-01 21:03:49 +08:00
grep -qx "DFS_CI=1" ~/.config/dotfiles/env
2023-02-01 21:20:21 +08:00
./install.sh -l
dfs version
test `git rev-parse HEAD` = `curl -fsSL https://api.beardic.cn/get-var/dfs-commit-id`
# clean
git reset --hard $DFS_VERSION
set +x