Clean project layout and fix release workflow
Some checks failed
build-windows-exe / build (push) Failing after 1m13s

This commit is contained in:
messypy
2026-07-27 23:01:24 +09:00
parent 3ff33e40e3
commit dd165d9301
80 changed files with 2908 additions and 5661 deletions

View File

@@ -0,0 +1,26 @@
package app
import (
"testing"
"time"
)
func TestDeduplicateJoinLeaveEventsIgnoresRepeatedReplays(t *testing.T) {
at := time.Date(2026, 7, 1, 1, 23, 45, 0, time.FixedZone("JST", 9*60*60))
events := []JoinLeaveEvent{
{At: at, Kind: "join", Name: "Alice", Count: 10},
{At: at, Kind: "join", Name: "Alice", Count: 11},
{At: at.Add(5 * time.Second), Kind: "leave", Name: "Alice", Count: 9},
}
got := dedupeJoinLeaveEvents(events)
if len(got) != 2 {
t.Fatalf("expected 2 unique events, got %d: %#v", len(got), got)
}
if got[0].Count != 10 {
t.Fatalf("expected first event to remain stable, got %#v", got[0])
}
if got[1].Kind != "leave" {
t.Fatalf("expected leave event to remain, got %#v", got[1])
}
}