Skip to content

Commit

Permalink
✅ - Test locking for watcher
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandpeelen committed Oct 23, 2023
1 parent e1f4d9a commit d34ceb5
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions tests/lock.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "./utils.sh"
cd ../testrepo

bold "Test: It should lock"
bold "Test: It should lock - when watching"

if rewatch clean &> /dev/null;
then
Expand All @@ -24,10 +24,27 @@ sleep 1
if rewatch watch 2>&1 | grep 'Error while trying to get lock:' &> /dev/null;
then
success "Lock is correctly set"
exit_watcher
else
error "Not setting lock correctly"
exit_watcher
exit 1
fi

exit_watcher
touch tmp.txt
rewatch watch &> tmp.txt &
success "Watcher Started"

sleep 1

if cat tmp.txt | grep 'Error while trying to get lock:' &> /dev/null;
then
error "Lock not removed correctly"
exit_watcher
exit 1
else
success "Lock removed correctly"
exit_watcher
fi

rm tmp.txt

0 comments on commit d34ceb5

Please sign in to comment.