aboutsummaryrefslogtreecommitdiffstats
path: root/test/data
diff options
context:
space:
mode:
authorMark Oteiza2017-09-09 11:55:09 -0400
committerMark Oteiza2017-09-09 12:26:50 -0400
commit4131f9785e30f2a31745125c714e922892113c62 (patch)
tree56858ce56448c799997008648b23e647cebd526d /test/data
parent68b7ecbac1dcb5bfcace5505a4d354777147dd54 (diff)
downloademacs-4131f9785e30f2a31745125c714e922892113c62.tar.gz
emacs-4131f9785e30f2a31745125c714e922892113c62.zip
Add function to read all entries in a group
Use that to extend xdg-desktop-read-file. Also fix a bug where all entries in all groups were read and returned by xdg-desktop-read-file. * lisp/xdg.el (xdg-desktop-read-group): New function. (xdg-desktop-read-file): Use it. * test/data/xdg/malformed.desktop: New file. * test/data/xdg/test.desktop: Add another section. * test/lisp/xdg-tests.el (xdg-desktop-parsing): Test presence of a key in another group. Test reading a prescribed group. Test detecting a malformed key=value.
Diffstat (limited to 'test/data')
-rw-r--r--test/data/xdg/malformed.desktop4
-rw-r--r--test/data/xdg/test.desktop2
2 files changed, 6 insertions, 0 deletions
diff --git a/test/data/xdg/malformed.desktop b/test/data/xdg/malformed.desktop
new file mode 100644
index 00000000000..144a3f719d5
--- /dev/null
+++ b/test/data/xdg/malformed.desktop
@@ -0,0 +1,4 @@
1# unacceptable key=value format
2[Desktop Entry]
3Key=value
4aowef faoweif of
diff --git a/test/data/xdg/test.desktop b/test/data/xdg/test.desktop
index b6dda62774a..b848cef5b0f 100644
--- a/test/data/xdg/test.desktop
+++ b/test/data/xdg/test.desktop
@@ -1,3 +1,5 @@
1# this is a comment 1# this is a comment
2[Desktop Entry] 2[Desktop Entry]
3Name=Test 3Name=Test
4[Another Section]
5Exec=frobnicate