|
@@ -29,6 +29,23 @@ func TestMenuRender(t *testing.T) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+func TestMenuSize(t *testing.T) {
|
|
|
+ defer func() {
|
|
|
+ if r := recover(); r == nil {
|
|
|
+ t.Error("Menu Exeeding Width did not panic.")
|
|
|
+ }
|
|
|
+ }()
|
|
|
+
|
|
|
+ m := Menu{Panel: Panel{Width: 5,
|
|
|
+ X: 1,
|
|
|
+ Y: 1,
|
|
|
+ Style: DOUBLE,
|
|
|
+ }}
|
|
|
+ // len("[A] ABC") = 7 (which is > 5)
|
|
|
+ m.AddSelection("A", "ABC")
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
func TestMenuConnection(t *testing.T) {
|
|
|
tmpFile, err := ioutil.TempFile(os.TempDir(), "test-")
|
|
|
if err != nil {
|