Files
LLeMbas-IDE/scripts/test-nvim.sh
T
HomerandClaude Fable 5.2 102d68349f Neovim: the four bars — top, bottom, tree, and the right bar with settings lines, chat and prompt
One table of keys binds every action in two forms (the terminal's chords, and keys that always
arrive), and the bottom bar shows the form that works for the bar that has the focus. The prompt
says what Enter will do (ask, rewrite, add; Tab switches in an empty prompt) and carries the
selection or the cursor's line as its attachment. Mode, effort, suggestions, AI on or off and
the bars are remembered per directory with a machine-wide default.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-02 20:33:22 +00:00

34 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
# The Neovim plugin's tests: headless, against the stand-in agent (tests/fake_agent.py) and, when its
# source is at hand, the LLeMbas CLI itself. Needs nvim 0.10+ and python3.
#
# scripts/test-nvim.sh both suites
# scripts/test-nvim.sh plugin the plugin on its own: chat, rewrite, suggestions, sign-in
# scripts/test-nvim.sh layout the bars: top, bottom, tree, right bar, keys, what is remembered
#
# Nothing of this machine's own Neovim is read or written: the state, data, cache and configuration
# directories are temporary ones, removed on every way out.
set -eu
cd "$(dirname "$0")/.."
WORK="$(mktemp -d "${TMPDIR:-/tmp}/llembas-nvim-test.XXXXXX")"
trap 'rm -rf "$WORK"' EXIT
trap 'exit 130' INT
trap 'exit 143' TERM
mkdir -p "$WORK/state" "$WORK/data" "$WORK/cache" "$WORK/config"
export XDG_STATE_HOME="$WORK/state" XDG_DATA_HOME="$WORK/data" XDG_CACHE_HOME="$WORK/cache" XDG_CONFIG_HOME="$WORK/config"
export LLEMBAS_NVIM_TEST_WORK="$WORK"
# The terminal these tests run in says nothing about itself to the plugin.
unset LLEMBAS_TERM LLEMBAS_TTY TMUX STY ZELLIJ KITTY_WINDOW_ID GHOSTTY_RESOURCES_DIR TERM_PROGRAM
export TERM=dumb
which="${1:-all}"
status=0
if [ "$which" = all ] || [ "$which" = plugin ]; then
nvim --headless -u NONE -i NONE --cmd "set rtp+=nvim" -l nvim/tests/run.lua || status=$?
fi
if [ "$which" = all ] || [ "$which" = layout ]; then
# With a screen (no -l): the bars are read from what is drawn.
nvim --headless -u NONE -i NONE --cmd "set rtp+=nvim" -c "luafile nvim/tests/layout.lua" || status=$?
fi
exit "$status"