mirror of
https://github.com/trapd00r/LS_COLORS.git
synced 2024-12-22 13:52:12 +01:00
Merge pull request #30 from rpdelaney/master
Completed comprehensive test suite
This commit is contained in:
commit
6bcd7cdd69
2 changed files with 16 additions and 14 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
test/*
|
29
buildsuite
29
buildsuite
|
@ -83,38 +83,39 @@ if [[ ! -d "./test" ]]; then mkdir test || exit 1; fi
|
|||
cd test || exit 1
|
||||
|
||||
# File
|
||||
touch FILE
|
||||
if [[ ! -f FILE ]]; then touch FILE; fi
|
||||
|
||||
# Executable file
|
||||
touch EXECUTABLE
|
||||
if [[ ! -f EXECUTABLE ]]; then touch EXECUTABLE; fi
|
||||
chmod +x EXECUTABLE
|
||||
|
||||
# Symlink
|
||||
ln -s FILE SYMLINK
|
||||
if [[ ! -f SYMLINK ]]; then ln -s FILE SYMLINK; fi
|
||||
|
||||
# Directory
|
||||
mkdir DIRECTORY
|
||||
if [[ ! -d DIRECTORY ]]; then mkdir DIRECTORY; fi
|
||||
|
||||
# Directory symlink
|
||||
ln -s DIRECTORY DIR-SYMLINK
|
||||
if [[ ! -d DIR-SYMLINK ]]; then ln -s DIRECTORY DIR-SYMLINK; fi
|
||||
|
||||
# Hardlink
|
||||
touch HARDLINK1
|
||||
ln HARDLINK1 HARDLINK2
|
||||
if [[ ! -f HARDLINK1 ]]; then touch HARDLINK1; fi
|
||||
if [[ ! -f HARDLINK2 ]]; then ln HARDLINK1 HARDLINK2; fi
|
||||
|
||||
# Create a link to nowhere
|
||||
touch nothing
|
||||
ln -s nothing ORPHAN
|
||||
rm nothing
|
||||
if [[ ! -f nothing ]]; then touch nothing; fi
|
||||
if [[ ! -f ORPHAN ]]; then ln -s nothing ORPHAN; fi
|
||||
if [[ -f nothing ]]; then rm nothing; fi
|
||||
|
||||
# World-writable
|
||||
touch WORLDWRITEABLE
|
||||
if [[ ! -f WORLDWRITEABLE ]]; then touch WORLDWRITEABLE; fi
|
||||
chmod 0777 WORLDWRITEABLE
|
||||
|
||||
# Supported extensions
|
||||
while read line; do
|
||||
:
|
||||
# echo "$line"
|
||||
done < <(sed -e '/^[ ]+#/d' ../LS_COLORS)
|
||||
if [[ ! -f test"$line" ]]; then
|
||||
touch ./DIRECTORY/test"$line"
|
||||
fi
|
||||
done < <(sed -r -e '/^[ ]+#/d; /^[^\.]/d; /^$/d' ../LS_COLORS | grep -Po '^\.([A-z0-9]+)' )
|
||||
|
||||
# vim: ft=sh foldmethod=marker:
|
||||
|
|
Loading…
Reference in a new issue