(t *testing.T)
| 229 | } |
| 230 | |
| 231 | func TestUnwrap(t *testing.T) { |
| 232 | rawChan := make(chan int) |
| 233 | ch := NewNativeChannel(5) |
| 234 | Unwrap(ch, rawChan) |
| 235 | |
| 236 | for i := 0; i < 5; i++ { |
| 237 | ch.In() <- i |
| 238 | } |
| 239 | ch.Close() |
| 240 | |
| 241 | for i := 0; i < 5; i++ { |
| 242 | x := <-rawChan |
| 243 | if x != i { |
| 244 | t.Error("Unwrapped value", x, "was expecting", i) |
| 245 | } |
| 246 | } |
| 247 | _, ok := <-rawChan |
| 248 | if ok { |
| 249 | t.Error("Unwrapped channel didn't close") |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | func ExampleChannel() { |
| 254 | var ch Channel |
nothing calls this directly
no test coverage detected
searching dependent graphs…