aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/automated/vc-hg.el58
-rw-r--r--test/lisp/net/tramp-tests.el17
-rwxr-xr-xtest/manual/indent/shell.sh3
3 files changed, 67 insertions, 11 deletions
diff --git a/test/automated/vc-hg.el b/test/automated/vc-hg.el
new file mode 100644
index 00000000000..ba966598c4d
--- /dev/null
+++ b/test/automated/vc-hg.el
@@ -0,0 +1,58 @@
1;;; vc-hg.el --- tests for vc/vc-hg.el
2
3;; Copyright (C) 2016 Free Software Foundation, Inc.
4
5;; Author: Dmitry Gutov <dgutov@yandex.ru>
6;; Maintainer: emacs-devel@gnu.org
7
8;; This file is part of GNU Emacs.
9
10;; GNU Emacs is free software: you can redistribute it and/or modify
11;; it under the terms of the GNU General Public License as published by
12;; the Free Software Foundation, either version 3 of the License, or
13;; (at your option) any later version.
14
15;; GNU Emacs is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; GNU General Public License for more details.
19
20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22
23;;; Commentary:
24
25;;; Code:
26
27(require 'vc-hg)
28(require 'vc-annotate)
29
30(ert-deftest vc-hg-annotate-extract-revision-at-line-with-filename ()
31 ;; with filename
32 (with-temp-buffer
33 (save-excursion (insert "215 2007-06-20 CONTENTS:"))
34 (should (equal (vc-hg-annotate-extract-revision-at-line)
35 (cons
36 "215"
37 (expand-file-name "CONTENTS"))))))
38
39(ert-deftest vc-hg-annotate-extract-revision-at-line-with-user ()
40 (with-temp-buffer
41 (save-excursion (insert " gerv 107217 2012-09-17:"))
42 (should (equal (vc-hg-annotate-extract-revision-at-line)
43 "107217"))))
44
45(ert-deftest vc-hg-annotate-extract-revision-at-line-with-both ()
46 (with-temp-buffer
47 (save-excursion (insert "philringnalda 218075 2014-11-28 CLOBBER:"))
48 (should (equal (vc-hg-annotate-extract-revision-at-line)
49 (cons
50 "218075"
51 (expand-file-name "CLOBBER"))))))
52
53(ert-deftest vc-hg-annotate-time ()
54 (with-temp-buffer
55 (save-excursion (insert "philringnalda 218075 2014-11-28 CLOBBER:"))
56 (should (floatp (vc-hg-annotate-time)))))
57
58;;; vc-hg.el ends here
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index f0725847699..305ca9d6770 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -44,6 +44,7 @@
44(require 'vc-git) 44(require 'vc-git)
45(require 'vc-hg) 45(require 'vc-hg)
46 46
47(autoload 'dired-uncache "dired")
47(declare-function tramp-find-executable "tramp-sh") 48(declare-function tramp-find-executable "tramp-sh")
48(declare-function tramp-get-remote-path "tramp-sh") 49(declare-function tramp-get-remote-path "tramp-sh")
49(declare-function tramp-get-remote-stat "tramp-sh") 50(declare-function tramp-get-remote-stat "tramp-sh")
@@ -1654,6 +1655,9 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
1654 (vc-register 1655 (vc-register
1655 nil (list (car vc-handled-backends) 1656 nil (list (car vc-handled-backends)
1656 (list (file-name-nondirectory tmp-name2)))))) 1657 (list (file-name-nondirectory tmp-name2))))))
1658 ;; vc-git uses an own process sentinel, Tramp's sentinel
1659 ;; for flushing the cache isn't used.
1660 (dired-uncache (concat (file-remote-p default-directory) "/"))
1657 (should (vc-registered (file-name-nondirectory tmp-name2))))) 1661 (should (vc-registered (file-name-nondirectory tmp-name2)))))
1658 1662
1659 ;; Cleanup. 1663 ;; Cleanup.
@@ -1777,14 +1781,6 @@ Several special characters do not work properly there."
1777 (file-truename tramp-test-temporary-file-directory) nil 1781 (file-truename tramp-test-temporary-file-directory) nil
1778 (string-match "^HP-UX" (tramp-get-connection-property v "uname" "")))) 1782 (string-match "^HP-UX" (tramp-get-connection-property v "uname" ""))))
1779 1783
1780(defun tramp--test-darwin-p ()
1781 "Check, whether the remote host runs Mac OS X.
1782Several special characters do not work properly there."
1783 ;; We must refill the cache. `file-truename' does it.
1784 (with-parsed-tramp-file-name
1785 (file-truename tramp-test-temporary-file-directory) nil
1786 (string-match "^Darwin" (tramp-get-connection-property v "uname" ""))))
1787
1788(defun tramp--test-check-files (&rest files) 1784(defun tramp--test-check-files (&rest files)
1789 "Run a simple but comprehensive test over every file in FILES." 1785 "Run a simple but comprehensive test over every file in FILES."
1790 ;; We must use `file-truename' for the temporary directory, because 1786 ;; We must use `file-truename' for the temporary directory, because
@@ -2030,16 +2026,15 @@ Use the `ls' command."
2030 2026
2031(defun tramp--test-utf8 () 2027(defun tramp--test-utf8 ()
2032 "Perform the test in `tramp-test32-utf8*'." 2028 "Perform the test in `tramp-test32-utf8*'."
2033 (tramp--instrument-test-case 10
2034 (let ((coding-system-for-read 'utf-8) 2029 (let ((coding-system-for-read 'utf-8)
2035 (coding-system-for-write 'utf-8) 2030 (coding-system-for-write 'utf-8)
2036 (file-name-coding-system 'utf-8)) 2031 (file-name-coding-system 'utf-8))
2037 (tramp--test-check-files 2032 (tramp--test-check-files
2038 (unless (tramp--test-hpux-p) "Γυρίστε το Γαλαξία με Ώτο Στοπ") 2033 (unless (tramp--test-hpux-p) "Γυρίστε το Γαλαξία με Ώτο Στοπ")
2039 (unless (or (tramp--test-hpux-p) (tramp--test-darwin-p)) 2034 (unless (tramp--test-hpux-p)
2040 "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت") 2035 "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت")
2041 "银河系漫游指南系列" 2036 "银河系漫游指南系列"
2042 "Автостопом по гала́ктике")))) 2037 "Автостопом по гала́ктике")))
2043 2038
2044(ert-deftest tramp-test32-utf8 () 2039(ert-deftest tramp-test32-utf8 ()
2045 "Check UTF8 encoding in file names and file contents." 2040 "Check UTF8 encoding in file names and file contents."
diff --git a/test/manual/indent/shell.sh b/test/manual/indent/shell.sh
index b0f69bd9720..dc184ea0d77 100755
--- a/test/manual/indent/shell.sh
+++ b/test/manual/indent/shell.sh
@@ -3,6 +3,9 @@
3 3
4setlock -n /tmp/getmail.lock && echo getmail isn\'t running 4setlock -n /tmp/getmail.lock && echo getmail isn\'t running
5 5
6toto=$(grep hello foo |
7 wc)
8
6# adsgsdg 9# adsgsdg
7 10
8if foo; then 11if foo; then