#!/bin/bash

# Create temporary directory for test data
TEST_DIR=$(mktemp -d)
echo "Test directory: $TEST_DIR"

# Test file storage
echo "Testing file storage..."

# Create test files
echo "# Test Heading" > "$TEST_DIR/test1.md"
echo "# Another Test" > "$TEST_DIR/test2.md"

# List files
ls "$TEST_DIR"/*.md

# Read file
CONTENT=$(cat "$TEST_DIR/test1.md")
echo "File content: $CONTENT"

# Delete file
rm "$TEST_DIR/test1.md"

# Check if file was deleted
if [ -f "$TEST_DIR/test1.md" ]; then
    echo "ERROR: File was not deleted"
else
    echo "SUCCESS: File was deleted"
fi

# Cleanup
rm -rf "$TEST_DIR"
echo "Test completed successfully"
