Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
X
xdg-utils
Manage
Activity
Members
Labels
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Freedesktop
xdg-utils
Commits
628e0246
Commit
628e0246
authored
4 years ago
by
Nicholas Guriev
Browse files
Options
Downloads
Patches
Plain Diff
Fix quoting issues in t-xdg-open.sh
Closes: #975228
parent
f3217557
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!4
New release: 1.1.3-3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
autotests/t-xdg-open.sh
+20
-21
20 additions, 21 deletions
autotests/t-xdg-open.sh
with
20 additions
and
21 deletions
autotests/t-xdg-open.sh
+
20
−
21
View file @
628e0246
...
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment