(t *testing.T)
| 45 | } |
| 46 | |
| 47 | func TestBasicDisconnectedMode(t *testing.T) { |
| 48 | tw := &testWriter{} |
| 49 | sm := MakeStreamManager() |
| 50 | |
| 51 | reader := strings.NewReader("hello world") |
| 52 | err := sm.AttachReader(reader) |
| 53 | if err != nil { |
| 54 | t.Fatalf("AttachReader failed: %v", err) |
| 55 | } |
| 56 | |
| 57 | time.Sleep(50 * time.Millisecond) |
| 58 | |
| 59 | packets := tw.GetPackets() |
| 60 | if len(packets) > 0 { |
| 61 | t.Errorf("Expected no packets in DISCONNECTED mode without client, got %d", len(packets)) |
| 62 | } |
| 63 | |
| 64 | sm.Close() |
| 65 | } |
| 66 | |
| 67 | func TestConnectedModeBasicFlow(t *testing.T) { |
| 68 | tw := &testWriter{} |
nothing calls this directly
no test coverage detected