Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1309)

Unified Diff: utils/voyeur/value_test.go

Issue 66000043: utils/voyeur: zero Value is ok to use
Patch Set: utils/voyeur: zero Value is ok to use Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils/voyeur/value.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/voyeur/value_test.go
=== modified file 'utils/voyeur/value_test.go'
--- utils/voyeur/value_test.go 2014-02-07 20:04:18 +0000
+++ utils/voyeur/value_test.go 2014-02-19 13:25:04 +0000
@@ -211,5 +211,17 @@
// prove the value is not closed, even though the watcher is
_, ok := v.Get()
c.Assert(ok, jc.IsTrue)
+}
+func (s *suite) TestWatchZeroValue(c *gc.C) {
+ var v Value
+ ch := make(chan bool)
+ go func() {
+ w := v.Watch()
+ ch <- true
+ ch <- w.Next()
+ }()
+ <-ch
+ v.Set(struct{}{})
+ c.Assert(<-ch, jc.IsTrue)
}
« no previous file with comments | « utils/voyeur/value.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b