interimap_init

# start a background process
interimap --watch=60 &
trap "ptree_abort $!" EXIT INT TERM

# wait a short while so we have time to lock the database (ugly and racy...)
sleep .5

# subsequent runs fail as we can't acquire the exclusive lock
! interimap || error

grep -Fx "DBD::SQLite::db do failed: database is locked at ./interimap line 176." <"$STDERR" \
    || error "Is \$DBH->do(\"PRAGMA locking_mode = EXCLUSIVE\"); at line 176?"

# vim: set filetype=sh :