mirror of
https://github.com/trapd00r/LS_COLORS.git
synced 2024-12-21 13:22:12 +01:00
Add test for duplicates
This commit is contained in:
parent
823dbcdde3
commit
a643ff951b
2 changed files with 26 additions and 0 deletions
18
run_tests
Executable file
18
run_tests
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
|
||||
errors=0
|
||||
|
||||
for file in ./tests/* ; do
|
||||
if [[ -e "$file" ]] ; then
|
||||
echo "$file"
|
||||
echo "--"
|
||||
bash "$file" ; ((errors += $?))
|
||||
echo ""
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ "$errors" -ne 0 ]] ; then
|
||||
echo "Test failures: $errors"
|
||||
exit "$errors"
|
||||
fi
|
8
tests/no_dupes
Executable file
8
tests/no_dupes
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
|
||||
exts="$(dircolors LS_COLORS | head -n1 | sed 's/=[^:]*//g ; s/:/\n/g')"
|
||||
exts_sorted="$(sort <<< "$exts")"
|
||||
exts_uniq="$(sort -u <<< "$exts")"
|
||||
|
||||
diff --color=auto --text --report-identical-files <(echo "$exts_uniq") <(echo "$exts_sorted")
|
Loading…
Reference in a new issue