diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2023-01-21 18:38:45 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2023-01-21 19:07:58 +0100 |
| commit | 74250577e643779a3afc2fe7be2465833c7fa134 (patch) | |
| tree | 9a626f080d4b2b1e3e277f8e415ec958591b5cfe /compat-tests.el | |
| parent | 7d61400bc9df955d269b06ae613f52d04c96dc55 (diff) | |
Fix file-name-quoted-p and file-name-quote
Diffstat (limited to 'compat-tests.el')
| -rw-r--r-- | compat-tests.el | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/compat-tests.el b/compat-tests.el index 4e8a0d6..17b59f8 100644 --- a/compat-tests.el +++ b/compat-tests.el @@ -1564,28 +1564,30 @@ (should-equal ":/bar/foo" (file-local-name "/ssh:::/bar/foo"))) (ert-deftest file-name-quoted-p () - (should-not (compat-call file-name-quoted-p "")) - (should (compat-call file-name-quoted-p "/:")) - (should-not (compat-call file-name-quoted-p "//:")) - (should (compat-call file-name-quoted-p "/::")) - (should-not (compat-call file-name-quoted-p "/ssh::")) - (should-not (compat-call file-name-quoted-p "/ssh::a")) - (should (compat-call file-name-quoted-p "/ssh::/:a")) + ;; TODO test TOP argument + (should-not (file-name-quoted-p "")) + (should (file-name-quoted-p "/:")) + (should-not (file-name-quoted-p "//:")) + (should (file-name-quoted-p "/::")) + (should-not (file-name-quoted-p "/ssh::")) + (should-not (file-name-quoted-p "/ssh::a")) + (should (file-name-quoted-p "/ssh::/:a")) ;; NOTE: These tests fails prior to Emacs 26, because /ssh:foo was a valid ;; TRAMP path back then. (when (>= emacs-major-version 26) - (should-not (compat-call file-name-quoted-p "/ssh:/:a")))) + (should-not (file-name-quoted-p "/ssh:/:a")))) (ert-deftest file-name-quote () - (should-equal "/:" (compat-call file-name-quote "")) - (should-equal "/::"(compat-call file-name-quote ":")) - (should-equal "/:/" (compat-call file-name-quote "/")) - (should-equal "/:" (compat-call file-name-quote "/:")) - (should-equal "/:a" (compat-call file-name-quote "a")) - (should-equal "/::a" (compat-call file-name-quote ":a")) - (should-equal "/:/a" (compat-call file-name-quote "/a")) - (should-equal "/:a" (compat-call file-name-quote "/:a")) - (should-equal (concat "/ssh:" (system-name) ":/:a") (compat-call file-name-quote "/ssh::a"))) + ;; TODO test TOP argument + (should-equal "/:" (file-name-quote "")) + (should-equal "/::"(file-name-quote ":")) + (should-equal "/:/" (file-name-quote "/")) + (should-equal "/:" (file-name-quote "/:")) + (should-equal "/:a" (file-name-quote "a")) + (should-equal "/::a" (file-name-quote ":a")) + (should-equal "/:/a" (file-name-quote "/a")) + (should-equal "/:a" (file-name-quote "/:a")) + (should-equal (concat "/ssh:" (system-name) ":/:a") (file-name-quote "/ssh::a"))) (ert-deftest file-name-concat () (should-equal (file-name-concat "foo" "bar") "foo/bar") |
