From 75bee4fee570bf56bd522970367479720cf1129f Mon Sep 17 00:00:00 2001 From: Kane York Date: Thu, 19 Nov 2015 16:31:10 -0800 Subject: [PATCH] Oops, forgot to remove test for deleted code --- socketserver/server/publisher_test.go | 80 --------------------------- 1 file changed, 80 deletions(-) delete mode 100644 socketserver/server/publisher_test.go diff --git a/socketserver/server/publisher_test.go b/socketserver/server/publisher_test.go deleted file mode 100644 index e3c0484f..00000000 --- a/socketserver/server/publisher_test.go +++ /dev/null @@ -1,80 +0,0 @@ -package server - -import ( - "testing" - "time" -) - -func TestCleanupBacklogMessages(t *testing.T) { - -} - -func TestFindFirstNewMessageEmpty(t *testing.T) { - CachedGlobalMessages = []TimestampedGlobalMessage{} - i := findFirstNewMessage(tgmarray(CachedGlobalMessages), time.Unix(10, 0)) - if i != -1 { - t.Errorf("Expected -1, got %d", i) - } -} -func TestFindFirstNewMessageOneBefore(t *testing.T) { - CachedGlobalMessages = []TimestampedGlobalMessage{ - {Timestamp: time.Unix(8, 0)}, - } - i := findFirstNewMessage(tgmarray(CachedGlobalMessages), time.Unix(10, 0)) - if i != -1 { - t.Errorf("Expected -1, got %d", i) - } -} -func TestFindFirstNewMessageSeveralBefore(t *testing.T) { - CachedGlobalMessages = []TimestampedGlobalMessage{ - {Timestamp: time.Unix(1, 0)}, - {Timestamp: time.Unix(2, 0)}, - {Timestamp: time.Unix(3, 0)}, - {Timestamp: time.Unix(4, 0)}, - {Timestamp: time.Unix(5, 0)}, - } - i := findFirstNewMessage(tgmarray(CachedGlobalMessages), time.Unix(10, 0)) - if i != -1 { - t.Errorf("Expected -1, got %d", i) - } -} -func TestFindFirstNewMessageInMiddle(t *testing.T) { - CachedGlobalMessages = []TimestampedGlobalMessage{ - {Timestamp: time.Unix(1, 0)}, - {Timestamp: time.Unix(2, 0)}, - {Timestamp: time.Unix(3, 0)}, - {Timestamp: time.Unix(4, 0)}, - {Timestamp: time.Unix(5, 0)}, - {Timestamp: time.Unix(11, 0)}, - {Timestamp: time.Unix(12, 0)}, - {Timestamp: time.Unix(13, 0)}, - {Timestamp: time.Unix(14, 0)}, - {Timestamp: time.Unix(15, 0)}, - } - i := findFirstNewMessage(tgmarray(CachedGlobalMessages), time.Unix(10, 0)) - if i != 5 { - t.Errorf("Expected 5, got %d", i) - } -} -func TestFindFirstNewMessageOneAfter(t *testing.T) { - CachedGlobalMessages = []TimestampedGlobalMessage{ - {Timestamp: time.Unix(15, 0)}, - } - i := findFirstNewMessage(tgmarray(CachedGlobalMessages), time.Unix(10, 0)) - if i != 0 { - t.Errorf("Expected 0, got %d", i) - } -} -func TestFindFirstNewMessageSeveralAfter(t *testing.T) { - CachedGlobalMessages = []TimestampedGlobalMessage{ - {Timestamp: time.Unix(11, 0)}, - {Timestamp: time.Unix(12, 0)}, - {Timestamp: time.Unix(13, 0)}, - {Timestamp: time.Unix(14, 0)}, - {Timestamp: time.Unix(15, 0)}, - } - i := findFirstNewMessage(tgmarray(CachedGlobalMessages), time.Unix(10, 0)) - if i != 0 { - t.Errorf("Expected 0, got %d", i) - } -}