|
@@ -187,8 +187,29 @@ func TestDoorInputConnection(t *testing.T) {
|
|
|
t.Errorf("Disconnected flag shows: %t (should be true)", d.Disconnected)
|
|
|
}
|
|
|
|
|
|
+ if !d.HasKey() {
|
|
|
+ t.Error("HasKey should return true (disconnected).")
|
|
|
+ }
|
|
|
+
|
|
|
+ hungup = d.GetKey()
|
|
|
+
|
|
|
+ if hungup != -2 {
|
|
|
+ t.Errorf("Expected -2 (hangup), got %d", hungup)
|
|
|
+ }
|
|
|
client.Close()
|
|
|
|
|
|
+ blank := d.Input(5)
|
|
|
+
|
|
|
+ if blank != "" {
|
|
|
+ t.Errorf("Input should return blank (hangup).")
|
|
|
+ }
|
|
|
+
|
|
|
+ hungup = d.getch()
|
|
|
+
|
|
|
+ if hungup != -2 {
|
|
|
+ t.Errorf("Expected -2 (hangup), got %d", hungup)
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
func TestDisplayInput(t *testing.T) {
|