ae: add test for resume triggering SyncChanges

This commit is contained in:
Frank Schroeder 2017-10-19 11:17:24 +02:00
parent 6de645a8b8
commit 1bb1a6787e
No known key found for this signature in database
GPG Key ID: 4D65C6EAEC87DECD
1 changed files with 16 additions and 2 deletions

View File

@ -27,7 +27,7 @@ func TestAE_scaleFactor(t *testing.T) {
}
}
func TestAE_nestedPauseResume(t *testing.T) {
func TestAE_Pause_nestedPauseResume(t *testing.T) {
t.Parallel()
l := NewStateSyner(nil, 0, nil, nil)
if l.Paused() != false {
@ -59,7 +59,21 @@ func TestAE_nestedPauseResume(t *testing.T) {
l.Resume()
}
func TestAE_ifNotPausedRun(t *testing.T) {
func TestAE_Pause_ResumeTriggersSyncChanges(t *testing.T) {
l := NewStateSyner(nil, 0, nil, nil)
l.Pause()
l.Resume()
select {
case <-l.SyncChanges.Notif():
// expected
case <-l.SyncFull.Notif():
t.Fatal("resume triggered SyncFull instead of SyncChanges")
default:
t.Fatal("resume did not trigger SyncFull")
}
}
func TestAE_Pause_ifNotPausedRun(t *testing.T) {
l := NewStateSyner(nil, 0, nil, nil)
errCalled := errors.New("f called")