Skip to content
Snippets Groups Projects
Commit 628e0246 authored by Nicholas Guriev's avatar Nicholas Guriev
Browse files

Fix quoting issues in t-xdg-open.sh

Closes: #975228
parent f3217557
No related branches found
No related tags found
1 merge request!4New release: 1.1.3-3
......@@ -7,10 +7,10 @@ test_open_url() {
shift
local cmd=$1
mock $cmd
run $de xdg-open http://www.freedesktop.org/
mock "$cmd"
run "$de" xdg-open http://www.freedesktop.org/
assert_run "$@" http://www.freedesktop.org/
unmock $cmd
unmock "$cmd"
}
mock_xdg_mime() {
......@@ -31,22 +31,21 @@ fi
test_generic_open_file() {
local filename="$1"
echo foo > "$LABDIR/$1"
mock_xdg_mime "$LABDIR/$1" text/plain textedit
echo foo > "$LABDIR/$filename"
mock_xdg_mime "$LABDIR/$filename" text/plain textedit
mock_desktop_file textedit %f
mock textedit
run generic xdg-open "$LABDIR/$1"
assert_run textedit "$LABDIR/$1"
run generic xdg-open "$LABDIR/$filename"
assert_run textedit "$LABDIR/$filename"
}
test_that_it opens a URL with "gio open" in recent GNOME 3, and Cinnamon
mock "gio open"
test_open_url gnome3 "gio open"
test_open_url cinnamon "gio open"
test_open_url gnome3 gio open
test_open_url cinnamon gio open
test_that_it opens a URL with gvfs-open if "gio open" is missing in GNOME 3, \
GNOME 2, and Cinnamon
mock_missing "gio open"
mock_missing gio
mock gvfs-open
test_open_url gnome3 gvfs-open
test_open_url gnome2 gvfs-open
......@@ -54,13 +53,13 @@ test_open_url cinnamon gvfs-open
test_that_it opens a URL with gnome-open if "gio open" and gvfs-open are \
missing in GNOME 2
mock_missing "gio open"
mock_missing gio
mock_missing gvfs-open
test_open_url gnome2 gnome-open
test_that_it opens a URL with the generic method if "gio open" and gvfs-open \
are missing in GNOME 3, and Cinnamon
mock_missing "gio open"
mock_missing gio
mock_missing gvfs-open
mock gnome-open
mock_desktop_file mosaic %u
......@@ -70,7 +69,7 @@ test_open_url cinnamon mosaic
test_that_it opens a URL with the generic method if "gio open", gvfs-open and \
gnome-open are missing in GNOME 2
mock_missing "gio open"
mock_missing gio
mock_missing gvfs-open
mock_missing gnome-open
mock_desktop_file mosaic %u
......@@ -91,7 +90,7 @@ test_open_url mate gvfs-open
test_that_it opens a URL with mate-open if "gio open" and gvfs-open are \
missing in MATE
mock_missing "gio open"
mock_missing gio
mock_missing gvfs-open
test_open_url mate mate-open
......@@ -103,15 +102,15 @@ test_open_url enlightenment enlightenment_open
test_that_it opens a file path with pcmanfm in LXDE
mock pcmanfm
touch $LABDIR/file.txt
run lxde xdg-open $LABDIR/file.txt
assert_run pcmanfm $(pwd)/$LABDIR/file.txt
touch "$LABDIR/file.txt"
run lxde xdg-open "$LABDIR/file.txt"
assert_run pcmanfm "$(pwd)/$LABDIR/file.txt"
test_that_it percent-decodes a file:// URL and opens it with pcmanfm in LXDE
mock pcmanfm
touch $LABDIR/file.txt
run lxde xdg-open file://$(pwd)/$LABDIR/file%2etxt
assert_run pcmanfm $(pwd)/$LABDIR/file.txt
touch "$LABDIR/file.txt"
run lxde xdg-open "file://$(pwd)/$LABDIR/file%2etxt"
assert_run pcmanfm "$(pwd)/$LABDIR/file.txt"
test_that_it opens files with spaces in their name in LXDE
echo foo > "$LABDIR/test file.txt"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment