1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

refactor tests

This commit is contained in:
ibizaman 2024-12-05 16:23:33 +01:00
parent 8955dc6133
commit 66a580c92b

View file

@ -11,24 +11,16 @@
file=${config.out}/etc/hosts file=${config.out}/etc/hosts
if [[ ! $(grep '127.0.0.1' $file | head -n1) =~ localhost$ ]]; then if ! grep '127.0.0.1' $file | head -n1 | grep localhost$; then
cat $file
echo "'$(grep '127.0.0.1' $file | head -n1)'"
exit 1 exit 1
fi fi
if [[ ! $(grep '127.0.0.1' $file | tail -n1) =~ my.super.host$ ]]; then if ! grep '127.0.0.1' $file | tail -n1 | grep my.super.host$; then
cat $file
echo "'$(grep '127.0.0.1' $file | tail -n1)'"
exit 2 exit 2
fi fi
if [[ ! $(grep '::1' $file) =~ localhost$ ]]; then if ! grep '::1' $file | grep localhost$; then
cat $file
echo "'$(grep '::1' $file)'"
exit 3 exit 3
fi fi
if [[ ! $(grep '10.0.0.1' $file) =~ my.super.host\ my.other.host$ ]]; then if ! grep '10.0.0.1' $file | grep my.super.host\ my.other.host$; then
cat $file
echo "'$(grep '10.0.0.1' $file)'"
exit 4 exit 4
fi fi
''; '';