#!/bin/sh

set -eu

mkdir -p "$AUTOPKGTEST_TMP"
cp -ra README.md lua "$AUTOPKGTEST_TMP"

#remove in-tree telescope dir
rm -rf "$AUTOPKGTEST_TMP"/lua/telescope
#copy shipped pickers.lua as tests look for it
cp /usr/share/neovim-telescope/lua/telescope/pickers.lua \
  "$AUTOPKGTEST_TMP/pickers.lua"

cd "$AUTOPKGTEST_TMP"

nvim --headless -c "PlenaryBustedDirectory lua/tests/automated/" +qa
