From d03c0b9932406b0f6d17efba28a1370911e1f994 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Mon, 7 Nov 2016 08:00:30 +0000 Subject: [PATCH] finish missing watcher check (#387) --- middleware/auto/watcher_test.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/middleware/auto/watcher_test.go b/middleware/auto/watcher_test.go index a8f219fa1..329d8dc85 100644 --- a/middleware/auto/watcher_test.go +++ b/middleware/auto/watcher_test.go @@ -36,10 +36,10 @@ func TestWatcher(t *testing.T) { // example.org and example.com should exist if x := len(a.Zones.Z["example.org."].All()); x != 4 { - t.Fatalf("expected 4 RRs, got %d", x) + t.Fatalf("Expected 4 RRs, got %d", x) } if x := len(a.Zones.Z["example.com."].All()); x != 4 { - t.Fatalf("expected 4 RRs, got %d", x) + t.Fatalf("Expected 4 RRs, got %d", x) } // Now remove one file, rescan and see if it's gone. @@ -48,5 +48,11 @@ func TestWatcher(t *testing.T) { } a.Walk() - // TODO(miek): check + + if _, ok := a.Zones.Z["example.com."]; ok { + t.Errorf("Expected %q to be gone.", "example.com.") + } + if _, ok := a.Zones.Z["example.org."]; !ok { + t.Errorf("Expected %q to still be there.", "example.org.") + } }