Skip to content

Commit

Permalink
Make sure all files are protected by build tags
Browse files Browse the repository at this point in the history
  • Loading branch information
arp242 committed Oct 14, 2022
1 parent ba99ec5 commit 23269be
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 26 deletions.
24 changes: 23 additions & 1 deletion fsevents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestBasicExample(t *testing.T) {
if err != nil {
t.Fatal(err)
}
select{
select {
case <-wait:
case <-time.After(5 * time.Second):
t.Fatal("timed out waiting for event")
Expand Down Expand Up @@ -149,3 +149,25 @@ func TestIssue48(t *testing.T) {
t.Fatal("eventstream error was not detected on >4096 files in watchlist")
}
}

func TestRegistry(t *testing.T) {
if registry.m == nil {
t.Fatal("registry not initialized at start")
}

es := &EventStream{}
i := registry.Add(es)

if registry.Get(i) == nil {
t.Fatal("failed to retrieve es from registry")
}

if es != registry.Get(i) {
t.Errorf("eventstream did not match what was found in the registry")
}

registry.Delete(i)
if registry.Get(i) != nil {
t.Error("failed to delete registry")
}
}
25 changes: 0 additions & 25 deletions registry_test.go

This file was deleted.

0 comments on commit 23269be

Please sign in to comment.