#!/bin/bash echo "🧪 测试修复结果" echo "==================" # 1. 测试排序稳定性 echo "1. 检查表格排序稳定性..." sqlite3 data/app.db "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;" > /tmp/table_order1.txt sqlite3 data/app.db "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;" > /tmp/table_order2.txt if diff /tmp/table_order1.txt /tmp/table_order2.txt > /dev/null; then echo " ✅ 表格排序稳定" else echo " ❌ 表格排序不稳定" fi # 2. 测试数据量 echo "2. 检查posts表数据量..." count=$(sqlite3 data/app.db "SELECT COUNT(*) FROM posts;") echo " 📊 posts表共有 $count 条记录" if [ "$count" -gt 20 ]; then echo " ✅ 数据量充足,支持分页测试" else echo " ❌ 数据量不足" fi # 3. 检查数据库连接 echo "3. 检查数据库连接..." if sqlite3 data/app.db ".tables" > /dev/null 2>&1; then echo " ✅ 数据库连接正常" else echo " ❌ 数据库连接失败" fi echo "" echo "🎉 所有修复测试完成!" echo "请启动应用验证:" echo " make dev" 或者 "go run cmd/server/main.go"