Skip to content

Commit cf7fc92

Browse files
Add some basic test scripts
1 parent 9151776 commit cf7fc92

5 files changed

Lines changed: 53 additions & 0 deletions

File tree

β€Žtest-scripts/bashβ€Ž

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
dir="$(cd "$(dirname "$0")" && pwd)"
5+
script="${dir}/../dist/ColorEcho.bash"
6+
. "${script}"
7+
8+
awk '/^function +echo/ {print $2}' "${script}" | while IFS= read -r x
9+
do
10+
$x "$x"
11+
done

β€Žtest-scripts/fishβ€Ž

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env fish
2+
3+
set dir (cd (dirname (status --current-filename)); and pwd)
4+
set script "$dir/../dist/ColorEcho.fish"
5+
. "$script"
6+
7+
for x in (awk '/^function +echo/ {print $2}' "$script")
8+
eval $x "$x"
9+
end

β€Žtest-scripts/kshβ€Ž

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env ksh
2+
3+
set -e
4+
dir="$(cd "$(dirname "${0}")" && pwd)"
5+
script="${dir}/../dist/ColorEcho.ksh"
6+
. "${script}"
7+
8+
awk '/^function +echo/ {print $2}' "${script}" | while IFS= read -r x
9+
do
10+
$x "$x"
11+
done

β€Žtest-scripts/shβ€Ž

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env sh
2+
3+
set -e
4+
dir="$(cd "$(dirname "$_")" && pwd)"
5+
script="${dir}/../dist/ColorEcho.sh"
6+
. "${script}"
7+
8+
grep -E "echo[a-zA-Z]+()" "${script}" | sed 's/()//g' | while IFS= read -r x
9+
do
10+
$x "$x"
11+
done

β€Žtest-scripts/zshβ€Ž

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env zsh
2+
3+
set -e
4+
dir="$(cd "$(dirname "${(%):-%N}")" && pwd)"
5+
script="${dir}/../dist/ColorEcho.zsh"
6+
. "${script}"
7+
8+
awk '/^function +echo/ {print $2}' "${script}" | while IFS= read -r x
9+
do
10+
$x "$x"
11+
done

0 commit comments

Comments
Β (0)