diff options
| author | Glenn Morris | 2013-08-04 18:32:00 -0700 |
|---|---|---|
| committer | Glenn Morris | 2013-08-04 18:32:00 -0700 |
| commit | 3e2cd454fdc04a1afefa23cdfe241c11862eaa8d (patch) | |
| tree | 59cfe8cfbfc47f11f238ed488964442ab3e9ee7a /lisp/international | |
| parent | d5671a82b8b78b5fd8d83cfc15642d2c0eff6de2 (diff) | |
| download | emacs-3e2cd454fdc04a1afefa23cdfe241c11862eaa8d.tar.gz emacs-3e2cd454fdc04a1afefa23cdfe241c11862eaa8d.zip | |
Extract truncate-string-to-width tests to a separate file
* test/automated/mule-util.el: New file, with tests extracted from
lisp/international/mule-util.el.
Copyright years based on when the original test-suite comment was
added to lisp/international/mule-util.el (in 2002).
* lisp/international/mule-util.el: Extract comment test-suite out to
separate file.
Diffstat (limited to 'lisp/international')
| -rw-r--r-- | lisp/international/mule-util.el | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el index 15a7dc10f65..21e09593187 100644 --- a/lisp/international/mule-util.el +++ b/lisp/international/mule-util.el | |||
| @@ -125,59 +125,6 @@ defaults to \"...\"." | |||
| 125 | (concat head-padding (substring str from-idx idx) | 125 | (concat head-padding (substring str from-idx idx) |
| 126 | tail-padding ellipsis)))) | 126 | tail-padding ellipsis)))) |
| 127 | 127 | ||
| 128 | ;;; Test suite for truncate-string-to-width | ||
| 129 | ;; (dolist (test '((("" 0) . "") | ||
| 130 | ;; (("x" 1) . "x") | ||
| 131 | ;; (("xy" 1) . "x") | ||
| 132 | ;; (("xy" 2 1) . "y") | ||
| 133 | ;; (("xy" 0) . "") | ||
| 134 | ;; (("xy" 3) . "xy") | ||
| 135 | ;; (("中" 0) . "") | ||
| 136 | ;; (("中" 1) . "") | ||
| 137 | ;; (("中" 2) . "中") | ||
| 138 | ;; (("中" 1 nil ? ) . " ") | ||
| 139 | ;; (("中文" 3 1 ? ) . " ") | ||
| 140 | ;; (("x中x" 2) . "x") | ||
| 141 | ;; (("x中x" 3) . "x中") | ||
| 142 | ;; (("x中x" 3) . "x中") | ||
| 143 | ;; (("x中x" 4 1) . "中x") | ||
| 144 | ;; (("kor한e글an" 8 1 ? ) . "or한e글") | ||
| 145 | ;; (("kor한e글an" 7 2 ? ) . "r한e ") | ||
| 146 | ;; (("" 0 nil nil "...") . "") | ||
| 147 | ;; (("x" 3 nil nil "...") . "x") | ||
| 148 | ;; (("中" 3 nil nil "...") . "中") | ||
| 149 | ;; (("foo" 3 nil nil "...") . "foo") | ||
| 150 | ;; (("foo" 2 nil nil "...") . "fo") ;; XEmacs failure? | ||
| 151 | ;; (("foobar" 6 0 nil "...") . "foobar") | ||
| 152 | ;; (("foobarbaz" 6 nil nil "...") . "foo...") | ||
| 153 | ;; (("foobarbaz" 7 2 nil "...") . "ob...") | ||
| 154 | ;; (("foobarbaz" 9 3 nil "...") . "barbaz") | ||
| 155 | ;; (("こhんeにlちlはo" 15 1 ? t) . " hんeにlちlはo") | ||
| 156 | ;; (("こhんeにlちlはo" 14 1 ? t) . " hんeにlち...") | ||
| 157 | ;; (("x" 3 nil nil "粵語") . "x") | ||
| 158 | ;; (("中" 2 nil nil "粵語") . "中") | ||
| 159 | ;; (("中" 1 nil ?x "粵語") . "x") ;; XEmacs error | ||
| 160 | ;; (("中文" 3 nil ? "粵語") . "中 ") ;; XEmacs error | ||
| 161 | ;; (("foobarbaz" 4 nil nil "粵語") . "粵語") | ||
| 162 | ;; (("foobarbaz" 5 nil nil "粵語") . "f粵語") | ||
| 163 | ;; (("foobarbaz" 6 nil nil "粵語") . "fo粵語") | ||
| 164 | ;; (("foobarbaz" 8 3 nil "粵語") . "b粵語") | ||
| 165 | ;; (("こhんeにlちlはo" 14 4 ?x "日本語") . "xeに日本語") | ||
| 166 | ;; (("こhんeにlちlはo" 13 4 ?x "日本語") . "xex日本語") | ||
| 167 | ;; )) | ||
| 168 | ;; (let (ret) | ||
| 169 | ;; (condition-case e | ||
| 170 | ;; (setq ret (apply #'truncate-string-to-width (car test))) | ||
| 171 | ;; (error (setq ret e))) | ||
| 172 | ;; (unless (equal ret (cdr test)) | ||
| 173 | ;; (error "%s: expected %s, got %s" | ||
| 174 | ;; (prin1-to-string (cons 'truncate-string-to-width (car test))) | ||
| 175 | ;; (prin1-to-string (cdr test)) | ||
| 176 | ;; (if (consp ret) | ||
| 177 | ;; (format "error: %s: %s" (car ret) | ||
| 178 | ;; (prin1-to-string (cdr ret))) | ||
| 179 | ;; (prin1-to-string ret)))))) | ||
| 180 | |||
| 181 | 128 | ||
| 182 | ;;; Nested alist handler. Nested alist is alist whose elements are | 129 | ;;; Nested alist handler. Nested alist is alist whose elements are |
| 183 | ;;; also nested alist. | 130 | ;;; also nested alist. |