package evidence import "testing" func TestForegroundTrackerChanged(t *testing.T) { var tr foregroundTracker if !tr.changed(true, 100, "A") { t.Fatal("first observation should always report changed") } if tr.changed(true, 100, "A") { t.Error("identical observation should not report changed") } if !tr.changed(true, 100, "B") { t.Error("title change on same hwnd should report changed") } if !tr.changed(true, 200, "B") { t.Error("hwnd change should report changed") } if !tr.changed(false, 0, "") { t.Error("transition to unavailable should report changed") } if tr.changed(false, 0, "") { t.Error("repeated unavailable should not report changed") } if !tr.changed(true, 200, "B") { t.Error("transition back to available should report changed") } }