7 func TestMessageInsertAndRetreive(t *testing.T) {
8 say := "'Ello, Mister Polly Parrot!"
10 var zero_time time.Time
11 store := start_store()
12 store.Add <- &Message{at, say}
13 messages_from_store := make(chan []Message, 1)
14 store.Get <- &StoreRequest{zero_time, messages_from_store}
15 messages := <-messages_from_store
16 if len(messages) != 1 {
19 if messages[0].Time != at {
22 if messages[0].Text != say {
29 func TestFetchBlocksUntilSpeak(t *testing.T) {
30 start_fetch_wait_count := fetch_wait_count.String()
31 say := "I've got a lovely fresh cuttle fish for you"
33 var zero_time time.Time
34 store := start_store()
35 messages_from_store := make(chan []Message, 1)
36 store.Get <- &StoreRequest{zero_time, messages_from_store}
37 for start_fetch_wait_count == fetch_wait_count.String() {
40 store.Add <- &Message{at, say}
41 messages := <-messages_from_store
42 if len(messages) != 1 {
45 if messages[0].Time != at {
48 if messages[0].Text != say {