Files
syncwarden/internal/monitor/conflicts_test.go
Axel Meyer 59a98843f7
Some checks failed
CI / lint (push) Failing after 27s
CI / test (push) Successful in 30s
Release / build (push) Failing after 2m33s
v0.3.0: fix HTTP client leak, add tests and CI pipeline
Reuse a single long-poll HTTP client instead of creating one per
Events() call (~every 30s). Make TLS skip-verify configurable via
syncthing_insecure_tls. Log previously swallowed config errors.
Add unit tests for all monitor trackers, config, and state logic.
Add CI workflow (vet, golangci-lint, govulncheck, go test -race).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 00:36:52 +01:00

29 lines
531 B
Go

package monitor
import "testing"
func TestConflictTracker_IncrementAndCount(t *testing.T) {
ct := NewConflictTracker()
if ct.Count() != 0 {
t.Fatalf("initial count should be 0, got %d", ct.Count())
}
ct.Increment()
ct.Increment()
ct.Increment()
if ct.Count() != 3 {
t.Errorf("expected 3, got %d", ct.Count())
}
}
func TestConflictTracker_SetCount(t *testing.T) {
ct := NewConflictTracker()
ct.Increment()
ct.SetCount(42)
if ct.Count() != 42 {
t.Errorf("expected 42 after SetCount, got %d", ct.Count())
}
}