Vladimir-csp / xdg-terminal-exec

Proposal for XDG Default Terminal Execution Specification and shell-based reference implementation.
GNU General Public License v3.0
77 stars 12 forks source link

quoting test fails #9

Closed twouters closed 1 year ago

twouters commented 1 year ago

Not sure what info you exactly need: I just cloned current master and ran bats test/:

$ bats --version
Bats 1.7.0
$ bash --version
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ bats test/       
tests.bats
 ✓ uses xterm -e as the fallback
 ✓ uses globally configured entry
 ✓ ignores missing config directory
 ✓ ignores missing data directory
 ✓ uses locally configured entry
 ✓ finds any global entry when there is no configuration
 ✓ uses configured exec arg
 ✓ adds default exec arg
 ✓ deals with large desktop entries
 ✓ finds any local entry when there is no configuration
 ✓ prefers earlier configured entry
 ✓ prefers locally configured entry
 ✓ ignores hidden entry
 ✓ ignores entry when its TryExec fails
 ✓ uses desktop-specific configuration when available
 ✓ uses desktop-agnostic configuration when none is available
 ✓ considers entry when its OnlyShowIn matches
 ✓ considers entry when its NotShowIn does not match
 ✓ ignores entry when its NotShowIn matches or its OnlyShowIn does not match
 ✗ quotes commands and arguments correctly
   (from function `assert_output' in file test/tests.bats, line 26,
    in test file test/tests.bats, line 201)
     `assert_output <<-'EOF'' failed
   status: 0
   output diff:
   --- /dev/fd/63   2023-01-12 16:42:38.897559484 +0100
   +++ /dev/fd/62   2023-01-12 16:42:38.897559484 +0100
   @@ -1,6 +1 @@
   -quoting terminal
   -with 'complex' arguments
   -and \"back\\slashes\"
   --e
   -and
   -custom arguments
   +'quotingn''terminaln''"withn'''complex'n''arguments"n'''andn''"back\slashes"'n''-en''andn''custom argumentsn'

20 tests, 1 failure
Vladimir-csp commented 1 year ago

Complex args processing is currently non-existent, but I have an idea on how to fix it.

Vladimir-csp commented 1 year ago

Now the whole exec line is constructed with correct argument splitting.