feat: enhanced leaderboard with floor/gold rankings and class info

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-24 15:33:16 +09:00
parent fb0e64a109
commit 5c5070502a
2 changed files with 58 additions and 7 deletions

View File

@@ -38,9 +38,9 @@ func TestRanking(t *testing.T) {
os.Remove("test_rank.db")
}()
db.SaveRun("Alice", 20, 1500)
db.SaveRun("Bob", 15, 1000)
db.SaveRun("Charlie", 20, 2000)
db.SaveRun("Alice", 20, 1500, "Warrior")
db.SaveRun("Bob", 15, 1000, "Mage")
db.SaveRun("Charlie", 20, 2000, "Rogue")
rankings, err := db.TopRuns(10)
if err != nil {
@@ -63,10 +63,10 @@ func TestGetStats(t *testing.T) {
defer db.Close()
// Save some runs
db.SaveRun("Alice", 5, 100)
db.SaveRun("Alice", 10, 250)
db.SaveRun("Alice", 20, 500) // victory (floor >= 20)
db.SaveRun("Bob", 3, 50)
db.SaveRun("Alice", 5, 100, "Warrior")
db.SaveRun("Alice", 10, 250, "Warrior")
db.SaveRun("Alice", 20, 500, "Warrior") // victory (floor >= 20)
db.SaveRun("Bob", 3, 50, "")
stats, err := db.GetStats("Alice")
if err != nil {