File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ func TestBasicExample(t *testing.T) {
5656 if err != nil {
5757 t .Fatal (err )
5858 }
59- select {
59+ select {
6060 case <- wait :
6161 case <- time .After (5 * time .Second ):
6262 t .Fatal ("timed out waiting for event" )
@@ -149,3 +149,25 @@ func TestIssue48(t *testing.T) {
149149 t .Fatal ("eventstream error was not detected on >4096 files in watchlist" )
150150 }
151151}
152+
153+ func TestRegistry (t * testing.T ) {
154+ if registry .m == nil {
155+ t .Fatal ("registry not initialized at start" )
156+ }
157+
158+ es := & EventStream {}
159+ i := registry .Add (es )
160+
161+ if registry .Get (i ) == nil {
162+ t .Fatal ("failed to retrieve es from registry" )
163+ }
164+
165+ if es != registry .Get (i ) {
166+ t .Errorf ("eventstream did not match what was found in the registry" )
167+ }
168+
169+ registry .Delete (i )
170+ if registry .Get (i ) != nil {
171+ t .Error ("failed to delete registry" )
172+ }
173+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments