72b5f644c4
- Remove fallback behavior for malformed SKILL.md files in skill_scanner.cpp - Now harness crashes immediately on invalid YAML frontmatter - Updated tests to use proper YAML frontmatter - Added new test_skill_validation.sh to verify crash behavior - Removed test that expected fallback for invalid frontmatter
42 lines
920 B
Bash
Executable File
42 lines
920 B
Bash
Executable File
#!/bin/bash
|
|
# test_skill_listing.sh - Verifies the -S flag correctly lists discovered skills
|
|
|
|
# Create test skill directories
|
|
mkdir -p skills
|
|
mkdir -p .skills
|
|
|
|
# Test 1: Skill with name and description
|
|
cat > skills/SKILL.md << 'SKILL'
|
|
---
|
|
name: test-skill
|
|
description: A test skill with description
|
|
---
|
|
|
|
# Test Skill Content
|
|
SKILL
|
|
|
|
# Test 2: Skill with only name (no description)
|
|
cat > .skills/SKILL.md << 'SKILL'
|
|
---
|
|
name: name-only-skill
|
|
---
|
|
|
|
# Name Only Skill Content
|
|
SKILL
|
|
|
|
# Run drharness with -S flag
|
|
OUTPUT=$("${DRHARNESS}" -S -F dummy.chat)
|
|
|
|
# Verify output contains the expected skills
|
|
if ! echo "$OUTPUT" | grep -q "test-skill - A test skill with description"; then
|
|
echo "FAIL: Expected 'test-skill - A test skill with description' in output"
|
|
exit 1
|
|
fi
|
|
|
|
if ! echo "$OUTPUT" | grep -q "name-only-skill"; then
|
|
echo "FAIL: Expected 'name-only-skill' in output"
|
|
exit 1
|
|
fi
|
|
|
|
echo "All tests passed!"
|