#!/bin/bash
# Script to test the attribution detection functionality
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${YELLOW}Testing attribution detection...${NC}"
# Create a test file with attribution
echo "This is a test file.
π€ Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>" > /tmp/test-attribution.txt
echo -e "Test file created with attribution messages."
echo -e "Contents of test file:"
cat /tmp/test-attribution.txt
echo ""
# Patterns to check for
ATTRIBUTION_PATTERNS=(
"Generated with Claude"
"Generated with \[Claude Code\]"
"Co-Authored-By: Claude"
"noreply@anthropic.com"
"Generated by AI"
"AI-generated"
"Generated by Claude"
"π€ Generated"
"Created with Claude"
)
# Check file for attribution patterns
FOUND=false
for pattern in "${ATTRIBUTION_PATTERNS[@]}"; do
if grep -q "$pattern" /tmp/test-attribution.txt; then
echo -e "${RED}Found AI attribution:${NC} '${YELLOW}$pattern${NC}'"
FOUND=true
fi
done
if [ "$FOUND" = true ]; then
echo -e "${GREEN}β Attribution detection is working correctly.${NC}"
else
echo -e "${RED}β Attribution detection failed to identify patterns.${NC}"
fi
# Clean up
rm /tmp/test-attribution.txt
echo "Test file removed."