diff --git a/tests/Makefile b/tests/Makefile
index f05ca5a..606008d 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -47,6 +47,8 @@ generate:
 		$(PYTHON) $(MM) -f pekwm -i > menus_test/pekwm_icons
 	XDGMENUMAKER_TEST=1 XDGMENUMAKERTERM=xterm LANG=en_US.utf8 \
 		$(PYTHON) $(MM) -f pekwm --pekwm-dynamic > menus_test/pekwm_dynamic
+	XDGMENUMAKER_TEST=1 XDGMENUMAKERTERM=xterm LANG=en_US.utf8 \
+		$(PYTHON) $(MM) -f twm > menus_test/twm
 	XDGMENUMAKER_TEST=1 XDGMENUMAKERTERM=xterm LANG=en_US.utf8 \
 		$(PYTHON) $(MM) -f windowmaker > menus_test/windowmaker
 
diff --git a/tests/menus_correct/twm b/tests/menus_correct/twm
new file mode 100644
index 0000000..79b3309
--- /dev/null
+++ b/tests/menus_correct/twm
@@ -0,0 +1,116 @@
+menu "xdgmenu"
+{
+    "Accessories" f.menu "Accessories"
+    "Development" f.menu "Development"
+    "Education" f.menu "Education"
+    "Games" f.menu "Games"
+    "Graphics" f.menu "Graphics"
+    "Multimedia" f.menu "Multimedia"
+    "Network" f.menu "Network"
+    "Office" f.menu "Office"
+    "Settings" f.menu "Settings"
+    "System" f.menu "System"
+}
+menu "Accessories"
+{
+    "Engrampa Archive Manager" f.exec "engrampa  &"
+    "GTKMan Manual Page Viewer" f.exec "gtkman salix &"
+    "Galculator" f.exec "galculator &"
+    "KeePassX" f.exec "keepassx  &"
+    "Leafpad" f.exec "leafpad  &"
+    "Search for Files..." f.exec "mate-search-tool &"
+    "Take Screenshot" f.exec "mate-screenshot --interactive &"
+    "Xournal" f.exec "xournal  &"
+    "Zim Desktop Wiki" f.exec "zim &"
+}
+menu "Development"
+{
+    "CMake" f.exec "cmake-gui  &"
+    "Geany" f.exec "geany  &"
+    "Glade" f.exec "glade-3  &"
+    "Meld" f.exec "meld  &"
+    "Poedit" f.exec "poedit  &"
+    "Qt4 Assistant" f.exec "assistant &"
+    "Qt4 Designer" f.exec "designer &"
+    "Qt4 Linguist" f.exec "linguist &"
+    "RStudio" f.exec "/usr/lib64/rstudio/bin/rstudio  &"
+}
+menu "Education"
+{
+    "LibreOffice 4.4 Math" f.exec "libreoffice4.4 --math  &"
+    "R" f.exec "xterm -e R &"
+}
+menu "Games"
+{
+    "KEGS" f.exec "xterm -e aoss xkegs &"
+}
+menu "Graphics"
+{
+    "Dia Diagram Editor" f.exec "dia  &"
+    "E-book Viewer" f.exec "ebook-viewer  &"
+    "GNU Image Manipulation Program" f.exec "gimp-2.8  &"
+    "Gcolor2" f.exec "gcolor2 &"
+    "LRF Viewer" f.exec "lrfviewer  &"
+    "LibreOffice 4.4 Draw" f.exec "libreoffice4.4 --draw  &"
+    "Simple Scan" f.exec "simple-scan &"
+    "Viewnior" f.exec "viewnior  &"
+}
+menu "Multimedia"
+{
+    "Asunder CD Ripper" f.exec "asunder &"
+    "Audacity" f.exec "audacity  &"
+    "Ex Falso" f.exec "exfalso &"
+    "Exaile" f.exec "exaile  &"
+    "GNOME MPlayer" f.exec "gnome-mplayer  &"
+    "Gaupol" f.exec "gaupol  &"
+    "ISO Master" f.exec "isomaster &"
+    "Quod Libet" f.exec "quodlibet &"
+}
+menu "Network"
+{
+    "Claws Mail" f.exec "claws-mail  &"
+    "Firefox" f.exec "firefox  &"
+    "Pidgin Internet Messenger" f.exec "pidgin &"
+    "Transmission" f.exec "transmission-gtk  &"
+    "gFTP" f.exec "gftp  &"
+    "ownCloud desktop sync client" f.exec "/usr/bin/owncloud &"
+}
+menu "Office"
+{
+    "Atril Document Viewer" f.exec "atril  &"
+    "Dictionary" f.exec "mate-dictionary &"
+    "HTMLDOC" f.exec "htmldoc  &"
+    "LibreOffice 4.4 Base" f.exec "libreoffice4.4 --base  &"
+    "LibreOffice 4.4 Calc" f.exec "libreoffice4.4 --calc  &"
+    "LibreOffice 4.4 Impress" f.exec "libreoffice4.4 --impress  &"
+    "LibreOffice 4.4 Writer" f.exec "libreoffice4.4 --writer  &"
+    "calibre" f.exec "calibre  &"
+}
+menu "Settings"
+{
+    "Bluetooth Manager" f.exec "blueman-manager &"
+    "Power Management" f.exec "mate-power-preferences &"
+    "Qt4 Config" f.exec "qtconfig &"
+    "Screensaver" f.exec "xscreensaver-demo &"
+}
+menu "System"
+{
+    "ALSA sound card" f.exec "gksu gtkalsasetup &"
+    "Disk Usage Analyzer" f.exec "mate-disk-usage-analyzer &"
+    "Dotnew" f.exec "gksu dotnew-gtk &"
+    "Grsync" f.exec "/usr/bin/grsync -i  &"
+    "Gslapt Package Manager" f.exec "gksu /usr/sbin/gslapt &"
+    "Hostnames" f.exec "gksu gtkhostsetup &"
+    "Htop" f.exec "xterm -e htop &"
+    "Keyboard" f.exec "gksu gtkkeyboardsetup &"
+    "Log File Viewer" f.exec "mate-system-log &"
+    "MATE Terminal" f.exec "mate-terminal &"
+    "Manage Printing" f.exec "/usr/bin/xdg-open http://localhost:631/ &"
+    "Power Statistics" f.exec "mate-power-statistics &"
+    "Sourcery SlackBuild Manager" f.exec "gksu sourcery &"
+    "System clock" f.exec "gksu gtkclocksetup &"
+    "System language" f.exec "gksu gtklocalesetup &"
+    "System services" f.exec "gksu gtkservicesetup &"
+    "Users and groups" f.exec "gksu gtkusersetup &"
+    "dconf Editor" f.exec "dconf-editor &"
+}