diff options
author | Julien Dessaux | 2021-01-12 15:55:41 +0100 |
---|---|---|
committer | Julien Dessaux | 2021-01-12 15:55:41 +0100 |
commit | 8c03774e1f05a1b9a87c5231562ba39989604773 (patch) | |
tree | a40aa7a2535ac565964059f798afb65a747e6416 /config/menu_test.go | |
parent | Continued implementing config validation (diff) | |
download | shell-game-launcher-8c03774e1f05a1b9a87c5231562ba39989604773.tar.gz shell-game-launcher-8c03774e1f05a1b9a87c5231562ba39989604773.tar.bz2 shell-game-launcher-8c03774e1f05a1b9a87c5231562ba39989604773.zip |
Updated menu tests to account properly for duplicate keys
Diffstat (limited to '')
-rw-r--r-- | config/menu_test.go | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/config/menu_test.go b/config/menu_test.go index 98405c7..d0b1805 100644 --- a/config/menu_test.go +++ b/config/menu_test.go @@ -26,24 +26,9 @@ func TestMenuValidate(t *testing.T) { t.Fatal("Negative YOffset should not be valid") } // MenuEntries are mostly tested bellow - menu = Menu{ - XOffset: 1, - YOffset: 1, - MenuEntries: []MenuEntry{ - MenuEntry{ - Key: "a", - Label: "test", - Action: "quit", - }, - MenuEntry{ - Key: "a", - Label: "duplicate", - Action: "quit", - }, - }, - } + menu = Menu{} if err := menu.validate("test"); err == nil { - t.Fatal("Duplicate Keys in MenuEntries should not be allowed") + t.Fatal("A menu without menu entries should not be valid") } // loop menu menu = Menu{ |