mirror of
https://github.com/bgreenwell/lstr.git
synced 2026-09-27 12:01:44 +02:00
- Remove the stale analysis report from the repo (an old planning file and local HTML renders were also deleted, untracked) - Commit the validation scripts and hand-verified golden baselines so contributors and CI can run the same checks; tighten their README - Slim the crates.io package (60 -> 21 files) by excluding examples, assets, CI config, and development scripts/docs - Document sort-flag precedence in help text and README: --dotfiles-first implies --dirs-first (verified identical output), --natural-sort takes precedence over --case-sensitive; simplify the README example that passed both redundantly - Refresh the README feature list to cover search, mouse support, editor resume, --du, display limits, and JSON output; fix the broken License link and a stray code-fence typo - Add AGENTS.md recording architecture, DFS-order invariants, and testing conventions (pty/expect requirements, Windows filename rules)
58 lines
2.1 KiB
Bash
Executable File
58 lines
2.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# Dual-mode testing script for lstr - ensures classic and TUI modes are consistent
|
|
|
|
set -e
|
|
|
|
echo "🔄 Testing dual-mode consistency..."
|
|
|
|
# Ensure we're in the right directory
|
|
if [ ! -d "examples/sample-directory" ]; then
|
|
echo "❌ Error: examples/sample-directory not found. Run from project root."
|
|
exit 1
|
|
fi
|
|
|
|
# Build the project
|
|
echo "🔨 Building project..."
|
|
cargo build
|
|
|
|
echo "📋 Testing classic mode outputs..."
|
|
|
|
# Generate classic mode outputs
|
|
cargo run examples/sample-directory -L 2 > /tmp/lstr-classic-depth2.txt
|
|
cargo run examples/sample-directory -G -p -L 2 > /tmp/lstr-classic-flags.txt
|
|
cargo run examples/sample-directory --dirs-first -L 2 > /tmp/lstr-classic-dirs.txt
|
|
|
|
echo "✅ Classic mode tests complete"
|
|
|
|
echo ""
|
|
echo "🖥️ Manual TUI Testing Required:"
|
|
echo " Run these commands and verify the tree structure matches classic mode:"
|
|
echo ""
|
|
echo " 1. Basic TUI (should match /tmp/lstr-classic-depth2.txt):"
|
|
echo " cargo run examples/sample-directory i -L 2"
|
|
echo ""
|
|
echo " 2. TUI with flags (should match /tmp/lstr-classic-flags.txt structure):"
|
|
echo " cargo run examples/sample-directory i -G -p"
|
|
echo ""
|
|
echo " 3. TUI with dirs-first (should match /tmp/lstr-classic-dirs.txt structure):"
|
|
echo " cargo run examples/sample-directory i --dirs-first -L 2"
|
|
echo ""
|
|
echo "🔍 Check for:"
|
|
echo " • Same tree connector patterns (├── and └──)"
|
|
echo " • Same file ordering within directories"
|
|
echo " • Same directory structure and nesting"
|
|
echo " • Proper alignment of permissions and git status"
|
|
echo ""
|
|
echo "📁 Classic outputs saved to /tmp/lstr-classic-*.txt for reference"
|
|
|
|
# If baseline files exist, compare
|
|
if [ -f "docs/baseline-outputs/depth-2.txt" ]; then
|
|
echo ""
|
|
echo "📊 Baseline Comparison:"
|
|
if diff -q docs/baseline-outputs/depth-2.txt /tmp/lstr-classic-depth2.txt > /dev/null; then
|
|
echo " ✅ Classic depth-2 matches baseline"
|
|
else
|
|
echo " ❌ Classic depth-2 differs from baseline"
|
|
echo " Run: diff docs/baseline-outputs/depth-2.txt /tmp/lstr-classic-depth2.txt"
|
|
fi
|
|
fi |