diff options
| author | Mark Oteiza | 2017-09-09 11:55:09 -0400 |
|---|---|---|
| committer | Mark Oteiza | 2017-09-09 12:26:50 -0400 |
| commit | 4131f9785e30f2a31745125c714e922892113c62 (patch) | |
| tree | 56858ce56448c799997008648b23e647cebd526d /test/data | |
| parent | 68b7ecbac1dcb5bfcace5505a4d354777147dd54 (diff) | |
| download | emacs-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.desktop | 4 | ||||
| -rw-r--r-- | test/data/xdg/test.desktop | 2 |
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] | ||
| 3 | Key=value | ||
| 4 | aowef 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] |
| 3 | Name=Test | 3 | Name=Test |
| 4 | [Another Section] | ||
| 5 | Exec=frobnicate | ||