aboutsummaryrefslogtreecommitdiff
path: root/repo.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-04-02 10:33:40 -0300
committerEuAndreh <eu@euandre.org>2023-04-02 16:36:23 -0300
commit22a7b4f0c8e018077984d58476a0c419b5e11942 (patch)
tree0343f0defd1bcea762dcce10b29c8c909661b577 /repo.sh
parentaux/dev.mk: make in parallel over for loop (diff)
downloadremembering-22a7b4f0c8e018077984d58476a0c419b5e11942.tar.gz
remembering-22a7b4f0c8e018077984d58476a0c419b5e11942.tar.xz
aux/checks/repo.sh: WIP Fix tests
Notes
See CI logs with: git notes --ref=refs/notes/ci-logs show 22a7b4f0c8e018077984d58476a0c419b5e11942 git notes --ref=refs/notes/ci-data show 22a7b4f0c8e018077984d58476a0c419b5e11942 Exit status: 2 Duration: 7
Diffstat (limited to '')
-rwxr-xr-xrepo.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/repo.sh b/repo.sh
new file mode 100755
index 0000000..7d81867
--- /dev/null
+++ b/repo.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+set -eu
+
+f() {
+ set -e
+ bad-command
+ unreachable
+ return 0
+}
+
+f && echo 'Executed, but shoult not'
+
+if f; then
+ echo 'Also executed, but should not'
+fi
+
+f || echo 'Not executed, but should be'
+
+if ! f; then
+ echo 'Also not executed, but should be'
+fi
+
+set -x
+set +e
+f
+STATUS=$?
+set -e
+if [ "$STATUS" != 0 ]; then
+ echo 'Only one that is executed when it should be'
+fi
+
+f
+echo 'This is *actually* unreachable'