2016-10-26 18:31:12 +00:00
|
|
|
;;; shell-tests.el -*- lexical-binding:t -*-
|
|
|
|
|
2020-01-01 00:19:43 +00:00
|
|
|
;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
|
2016-10-26 18:31:12 +00:00
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2017-09-13 22:52:52 +00:00
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2016-10-26 18:31:12 +00:00
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;; Tests for comint and related modes.
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
(require 'shell)
|
|
|
|
(require 'ert)
|
|
|
|
|
|
|
|
(ert-deftest shell-tests-unquote-1 ()
|
|
|
|
"Test problem found by Filipp Gunbin in emacs-devel."
|
|
|
|
(should (equal (car (shell--unquote&requote-argument "te'st" 2)) "test")))
|
|
|
|
|
2018-12-04 17:39:47 +00:00
|
|
|
(ert-deftest shell-tests-completion-before-semi ()
|
|
|
|
(with-temp-buffer
|
|
|
|
(shell-mode)
|
|
|
|
(insert "cd ba;")
|
2020-01-20 14:52:27 +00:00
|
|
|
(forward-char -1)
|
2018-12-04 17:39:47 +00:00
|
|
|
(should (equal (shell--parse-pcomplete-arguments)
|
2020-01-20 14:52:27 +00:00
|
|
|
'(("cd" "ba") 1 4)))))
|
|
|
|
|
|
|
|
(ert-deftest shell-tests-completion-after-semi ()
|
|
|
|
(with-temp-buffer
|
|
|
|
(shell-mode)
|
|
|
|
(insert "cd ba;")
|
|
|
|
(should (equal (shell--parse-pcomplete-arguments)
|
|
|
|
'(("cd" "ba" "") 1 4 7)))))
|
2018-12-04 17:39:47 +00:00
|
|
|
|
2016-10-26 18:31:12 +00:00
|
|
|
;;; shell-tests.el ends here
|