| 1234567891011121314151617181920212223242526272829 |
- package main
- import (
- "testing"
- "fmt"
- "time"
- )
- func TestWatch(t *testing.T) {
- // watcher := createWatcher()
- c := make(chan Response)
- d := make(chan Response)
- w.add("/", c)
- go say(c)
- w.add("/prefix/", d)
- go say(d)
- s.Set("/prefix/foo", "bar", time.Unix(0, 0))
- }
- func say(c chan Response) {
- result := <-c
- if result.Action != -1 {
- fmt.Println("yes")
- } else {
- fmt.Println("no")
- }
- }
|