summaryrefslogtreecommitdiffstats
path: root/menu/tests
diff options
context:
space:
mode:
authorWaldo Bastian <waldo.bastian@intel.com>2005-04-21 09:15:31 +0000
committerWaldo Bastian <waldo.bastian@intel.com>2005-04-21 09:15:31 +0000
commitbb600038d866852ff90f0124ba2fe6526b71585d (patch)
tree2c3350fb4930171b07c6ce09a4a33a02de3e05f1 /menu/tests
parent5128e55ac6d14a2bc4a8b1522c03782cddbe734d (diff)
downloadxdg-specs-bb600038d866852ff90f0124ba2fe6526b71585d.tar.xz
test s: Test that .desktop files under $HOME correctly
override .desktop files at system level test t: Test order in which <Move> elements are processed
Diffstat (limited to 'menu/tests')
-rw-r--r--menu/tests/ChangeLog9
-rw-r--r--menu/tests/data/glines-2.desktop83
-rw-r--r--menu/tests/data/mahjongg-2.desktop86
-rwxr-xr-xmenu/tests/menutest7
-rw-r--r--menu/tests/tests/s/result3
-rw-r--r--menu/tests/tests/s/test51
-rw-r--r--menu/tests/tests/t/result3
-rw-r--r--menu/tests/tests/t/test47
8 files changed, 289 insertions, 0 deletions
diff --git a/menu/tests/ChangeLog b/menu/tests/ChangeLog
index 0178301..b813a7e 100644
--- a/menu/tests/ChangeLog
+++ b/menu/tests/ChangeLog
@@ -1,3 +1,12 @@
+2005-04-20 Waldo Bastian <bastian@kde.org>
+
+ * tests/s/result,
+ tests/s/test: Test that .desktop files under $HOME correctly
+ override .desktop files at system level
+
+ * tests/t/result,
+ tests/t/test: Test order in which <Move> elements are processed
+
2005-02-18 Mark McLoughlin <mark@skynet.ie>
Make it a bit more difficult in order to catch:
diff --git a/menu/tests/data/glines-2.desktop b/menu/tests/data/glines-2.desktop
new file mode 100644
index 0000000..266747d
--- /dev/null
+++ b/menu/tests/data/glines-2.desktop
@@ -0,0 +1,83 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=Glines
+Name[be]=Glines
+Name[bg]=ГЛинии
+Name[bn]=জীলাইন্‌স
+Name[ca]=Glines
+Name[cs]=Glines
+Name[da]=Linjer
+Name[de]=Glines
+Name[el]=Glines
+Name[es]=Glines
+Name[et]=Glines
+Name[eu]=Glines
+Name[fi]=Glines
+Name[fr]=Glines
+Name[he]=Glines
+Name[hu]=Glines
+Name[it]=Glines
+Name[ja]=Glines
+Name[ko]=Glines
+Name[lt]=Glines
+Name[lv]=Glines
+Name[mn]=Glines
+Name[ms]=Glines
+Name[nl]=GLines
+Name[no]=Glines
+Name[pl]=Glines
+Name[pt]=GLinhas
+Name[pt_BR]=Glines
+Name[ro]=Glines
+Name[ru]=Glines
+Name[sk]=GČiary
+Name[sl]=Glines
+Name[sv]=Glinjer
+Name[tr]=Sıradaki toplar
+Name[uk]=Ряди
+Name[vi]=Glines
+Name[wa]=GRoyes
+Name[zh_CN]=Glines
+Name[zh_TW]=Glines
+Comment=Color lines game
+Comment[be]=Гульня "Каляровыя лініі"
+Comment[bg]=Игра Цветни линии
+Comment[bn]=কালার লাইন্‌স খেলা
+Comment[ca]=Joc de línies de color
+Comment[cs]=Hra Barevné linie
+Comment[da]=Farvede linjer-spil
+Comment[de]=Farblinienspiel
+Comment[el]=Παιχνίδι γραμμών χρώματος
+Comment[es]=Juego del tipo líneas de colores.
+Comment[fi]=Väriviivapeli
+Comment[fr]=Jeu de lignes colorées
+Comment[he]=משחק שורות צבעוניות
+Comment[hu]=Color lines játék
+Comment[it]=Gioco Color Lines
+Comment[ja]=カラーラインのゲーム
+Comment[lv]=Krāsu līniju spēle
+Comment[mn]=Өнгөт бөмбөлөг тоглоом
+Comment[ms]=Permainan garisan warna
+Comment[nl]=Kleurlijnen
+Comment[no]=Spill med fargelinjer
+Comment[pl]=Gra w kolorowe linie
+Comment[pt]=Jogo das linhas coloridas
+Comment[pt_BR]=Jogo de linhas coloridas
+Comment[ru]=Игра "Цветные линии"
+Comment[sk]=Hra Farebné čiary
+Comment[sl]=Igra barvnih črt
+Comment[sv]=Färglinjespel
+Comment[tr]=Color lines oyunu
+Comment[uk]=Гра "Кольорові ряди"
+Comment[vi]=Trò chơi ColorLines
+Comment[zh_TW]=Color lines 遊戲
+Exec=glines
+Icon=glines.png
+Terminal=false
+Type=Application
+Categories=GNOME;Application;Game;PuzzleGame;
+X-GNOME-Bugzilla-Bugzilla=GNOME
+X-GNOME-Bugzilla-Product=gnome-games
+X-GNOME-Bugzilla-Component=glines
+StartupNotify=true
+NoDisplay=true
diff --git a/menu/tests/data/mahjongg-2.desktop b/menu/tests/data/mahjongg-2.desktop
new file mode 100644
index 0000000..95cfe27
--- /dev/null
+++ b/menu/tests/data/mahjongg-2.desktop
@@ -0,0 +1,86 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=Mahjongg
+Name[am]=ማህጆንግ
+Name[be]=Маджонг
+Name[bg]=Махджонг
+Name[bn]=মাহজং
+Name[ca]=Mahjongg
+Name[cs]=Mahjongg
+Name[da]=Mahjongg
+Name[de]=Mahjongg
+Name[el]=Mahjongg
+Name[es]=Mahjongg
+Name[et]=Mahjongg
+Name[fa]=ماهجونگ
+Name[fi]=Mahjongg
+Name[fr]=Mahjongg
+Name[gl]=Mahjongg
+Name[he]=Mahjongg
+Name[hu]=Mahjongg
+Name[it]=Mahjongg
+Name[ja]=GNOME 上海
+Name[ko]=그놈 마작
+Name[lt]=Mahjongg
+Name[lv]=Mahjongg
+Name[mn]=Маджонг
+Name[ms]=Mahjongg
+Name[nl]=Mahjongg
+Name[no]=Mahjongg
+Name[pl]=Mahjongg
+Name[pt]=Mahjongg
+Name[pt_BR]=Mahjongg
+Name[ru]=Маджонг
+Name[sk]=Mahjongg
+Name[sl]=Mahjongg
+Name[sv]=Mah Jong
+Name[tr]=Mahjongg
+Name[uk]=Магджонґ
+Name[vi]=Mahjongg
+Name[wa]=Mahjongg
+Name[zh_CN]=堆麻将
+Name[zh_TW]=上海麻將
+Comment=Mahjongg game
+Comment[am]=የማህጆንግ ጨዋታ
+Comment[be]=Гульня Маджонг
+Comment[bg]=Игра на Махджонг
+Comment[bn]=মাহজং খেলা
+Comment[ca]=Joc del Mahjongg
+Comment[cs]=Hra Mahjongg
+Comment[da]=Mahjonggspil
+Comment[de]=Mahjongg-Spiel
+Comment[el]=Παιχνίδι Mahjongg
+Comment[es]=Juego Mahjongg
+Comment[et]=Mäng nimega mahjongg
+Comment[fa]=بازی ماهجونگ
+Comment[fi]=Mahjongg-peli
+Comment[fr]=Jeu de Mahjongg
+Comment[he]=משחק Mahjongg
+Comment[hu]=Mahjongg játék
+Comment[it]=Gioco Mahjongg
+Comment[ja]=麻雀ゲーム
+Comment[lv]=Mahjongg spēle
+Comment[mn]=Mahjongg тоглоом
+Comment[ms]=Permainan Mahjongg
+Comment[nl]=Mahjongg
+Comment[no]=Mahjongg-spill
+Comment[pl]=Gra Mahjongg
+Comment[pt]=Jogo Mahjongg
+Comment[pt_BR]=Jogo Mahjongg
+Comment[ru]=Игра Маджонг
+Comment[sk]=Hra Mahjongg
+Comment[sl]=Igra Mahjongg
+Comment[sv]=Mah Jong-spel
+Comment[tr]=Mahjongg oyunu
+Comment[uk]=Гра "Магджонґ"
+Comment[vi]=Trò chơi Mahjongg
+Comment[zh_TW]=上海麻將遊戲
+Exec=mahjongg
+Icon=gnome-mahjongg.png
+Terminal=false
+Type=Application
+Categories=GNOME;Application;Development;
+X-GNOME-Bugzilla-Bugzilla=GNOME
+X-GNOME-Bugzilla-Product=gnome-games
+X-GNOME-Bugzilla-Component=mahjongg
+StartupNotify=true
diff --git a/menu/tests/menutest b/menu/tests/menutest
index 861a50d..adf93d8 100755
--- a/menu/tests/menutest
+++ b/menu/tests/menutest
@@ -10,6 +10,13 @@ function installData()
done
}
+function installDataAs()
+{
+ local DIR=$1
+ mkdir -p ${DIR}
+ cp data/$2 ${DIR}/$3
+}
+
if [ "x${MENUTEST}" == "x" ]; then
echo 'To run the test set $MENUTEST to your menu-spec implementation.'
exit 1
diff --git a/menu/tests/tests/s/result b/menu/tests/tests/s/result
new file mode 100644
index 0000000..664105a
--- /dev/null
+++ b/menu/tests/tests/s/result
@@ -0,0 +1,3 @@
+Development/ kde-gideon.desktop /tmp/menutestdir/xdg_data_home/applications/kde-gideon.desktop
+Development/ mahjongg.desktop /tmp/menutestdir/xdg_data_home/applications/mahjongg.desktop
+Games/ freecell.desktop /tmp/menutestdir/xdg_data_home/applications/freecell.desktop
diff --git a/menu/tests/tests/s/test b/menu/tests/tests/s/test
new file mode 100644
index 0000000..f332434
--- /dev/null
+++ b/menu/tests/tests/s/test
@@ -0,0 +1,51 @@
+echo ">>> .desktop files with same name ..."
+
+# Tests the type attribute in <MergeFile>
+
+# 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/>
+ <Menu>
+ <Name>Games</Name>
+ <Include>
+ <Category>Game</Category>
+ </Include>
+ </Menu>
+ <Menu>
+ <Name>Development</Name>
+ <Include>
+ <Category>Development</Category>
+ </Include>
+ </Menu>
+</Menu>
+EOF
+
+# Install .desktop files
+installData ${XDG_DATA_DIR}/applications freecell.desktop glines.desktop mahjongg.desktop
+
+# freecell.desktop is installed twice, only the version under ${XDG_DATA_HOME}/applications
+# should show up in the menu
+# freecell.desktop in ${XDG_DATA_DIR}/applications should be ignored.
+installData ${XDG_DATA_HOME}/applications freecell.desktop
+
+# ${XDG_DATA_HOME}/applications/glines.desktop has NoDisplay=true
+# glines.desktop should not be shown
+# glines.desktop in ${XDG_DATA_DIR}/applications should be ignored.
+installDataAs ${XDG_DATA_HOME}/applications glines-2.desktop glines.desktop
+
+# ${XDG_DATA_HOME}/applications/mahjongg.desktop has Categories=Development
+# mahjongg.desktop should be shown under the Development menu
+# mahjongg.desktop in ${XDG_DATA_DIR}/applications should be ignored.
+installDataAs ${XDG_DATA_HOME}/applications mahjongg-2.desktop mahjongg.desktop
+
+# kde/gideon.desktop and kde-gideon.desktop are equivalent
+# only the version under ${XDG_DATA_HOME}/applications should show up in the menu
+# gideon.desktop in ${XDG_DATA_DIR}/applications/kde should be ignored.
+installDataAs ${XDG_DATA_DIR}/applications/kde gideon.desktop
+installDataAs ${XDG_DATA_HOME}/applications gideon.desktop kde-gideon.desktop
diff --git a/menu/tests/tests/t/result b/menu/tests/tests/t/result
new file mode 100644
index 0000000..a171b0d
--- /dev/null
+++ b/menu/tests/tests/t/result
@@ -0,0 +1,3 @@
+Development/ gideon.desktop /tmp/menutestdir/xdg_data_dir/applications/gideon.desktop
+Games-Correct/ freecell.desktop /tmp/menutestdir/xdg_data_dir/applications/freecell.desktop
+Games-Correct/ glines.desktop /tmp/menutestdir/xdg_data_dir/applications/glines.desktop
diff --git a/menu/tests/tests/t/test b/menu/tests/tests/t/test
new file mode 100644
index 0000000..8fccd16
--- /dev/null
+++ b/menu/tests/tests/t/test
@@ -0,0 +1,47 @@
+echo ">>> Order of <Move> operations ..."
+
+# Tests the type attribute in <MergeFile>
+
+# 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/>
+ <Menu>
+ <Name>Development</Name>
+ <Menu>
+ <Name>Games</Name>
+ <Include>
+ <Category>Game</Category>
+ </Include>
+ </Menu>
+ <Include>
+ <Category>Development</Category>
+ </Include>
+ </Menu>
+ <Move>
+ <Old>Development/Games-New</Old>
+ <New>Games-Correct</New>
+ </Move>
+ <Move>
+ <Old>Development/Games</Old>
+ <New>Games-Wrong</New>
+ </Move>
+ <Menu>
+ <Name>Development</Name>
+ <Move>
+ <Old>Games</Old>
+ <New>Games-New</New>
+ </Move>
+ </Menu>
+</Menu>
+EOF
+
+# Move operations in sub-menus should be performed first
+
+# Install .desktop files
+installData ${XDG_DATA_DIR}/applications freecell.desktop glines.desktop gideon.desktop