summaryrefslogtreecommitdiffstats
path: root/menu/tests/tests
diff options
context:
space:
mode:
Diffstat (limited to 'menu/tests/tests')
-rw-r--r--menu/tests/tests/o/result3
-rw-r--r--menu/tests/tests/o/test33
2 files changed, 36 insertions, 0 deletions
diff --git a/menu/tests/tests/o/result b/menu/tests/tests/o/result
new file mode 100644
index 0000000..446f6b6
--- /dev/null
+++ b/menu/tests/tests/o/result
@@ -0,0 +1,3 @@
+Apps/ KEdit.desktop /tmp/menutestdir/xdg_data_dir/applications/KEdit.desktop
+Apps/ kwrite.desktop /tmp/menutestdir/xdg_data_dir/applications/kwrite.desktop
+Apps/ kate.desktop /tmp/menutestdir/xdg_data_dir/applications/kate.desktop
diff --git a/menu/tests/tests/o/test b/menu/tests/tests/o/test
new file mode 100644
index 0000000..93afee5
--- /dev/null
+++ b/menu/tests/tests/o/test
@@ -0,0 +1,33 @@
+echo ">>> <And><Category>foo</Category><Not><Category>foo</Category></Not></And> shouldn't match anything"
+
+# Generate applications.menu
+mkdir -p ${XDG_CONFIG_DIR}/menus
+./expand > ${XDG_CONFIG_DIR}/menus/applications.menu <<EOF
+ <!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
+ "http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
+
+<Menu>
+ <Name>KDE</Name>
+
+ <DefaultAppDirs/>
+ <DefaultDirectoryDirs/>
+
+ <Menu>
+ <Name>Applications</Name>
+ <Directory>apps.directory</Directory>
+ <Include>
+ <Or>
+ <Category>TextEditor</Category>
+ <And>
+ <Category>Game</Category>
+ <Not><Category>Game</Category></Not>
+ </And>
+ </Or>
+ </Include>
+ </Menu>
+</Menu>
+EOF
+
+# Install .desktop files
+installData ${XDG_DATA_DIR}/applications kwrite.desktop KEdit.desktop kate.desktop freecell.desktop
+installData ${XDG_DATA_DIR}/desktop-directories apps.directory