diff options
Diffstat (limited to 'test')
43 files changed, 2029 insertions, 465 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index add4d9c7664..f44b09102d9 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,85 @@ | |||
| 1 | 2012-02-13 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 2 | |||
| 3 | * automated/url-future-tests.el (url-future-tests): Move from | ||
| 4 | lisp/url/url-future.el and rename. | ||
| 5 | |||
| 6 | 2012-01-29 Ulf Jasper <ulf.jasper@web.de> | ||
| 7 | |||
| 8 | * automated/icalendar-tests.el (icalendar-import-non-recurring): | ||
| 9 | Fix broken test, caused by missing trailing blank. | ||
| 10 | |||
| 11 | 2011-12-03 Chong Yidong <cyd@gnu.org> | ||
| 12 | |||
| 13 | * automated/compile-tests.el (compile-tests--test-regexps-data): | ||
| 14 | Increase column numbers by one to reflect change in how | ||
| 15 | compilation-message is recorded (Bug#10172). | ||
| 16 | |||
| 17 | 2011-11-22 Glenn Morris <rgm@gnu.org> | ||
| 18 | |||
| 19 | * rmailmm.el: New file, split from lisp/mail/rmailmm.el. | ||
| 20 | |||
| 21 | 2011-11-20 Juanma Barranquero <lekktu@gmail.com> | ||
| 22 | |||
| 23 | * cedet/semantic-utest-c.el (semantic-utest-c-comparisons): Fix typo. | ||
| 24 | |||
| 25 | 2011-11-16 Juanma Barranquero <lekktu@gmail.com> | ||
| 26 | |||
| 27 | * automated/icalendar-tests.el (icalendar-tests--get-ical-event) | ||
| 28 | (icalendar-tests--test-export, icalendar-tests--do-test-export): | ||
| 29 | * cedet/srecode-tests.el (srecode-field-utest-impl): Fix typo. | ||
| 30 | |||
| 31 | 2011-10-30 Ulf Jasper <ulf.jasper@web.de> | ||
| 32 | |||
| 33 | * automated/newsticker-tests.el | ||
| 34 | (newsticker--group-manage-orphan-feeds): Remove fsetting of | ||
| 35 | newsticker--treeview-tree-update. | ||
| 36 | |||
| 37 | 2011-10-29 Ulf Jasper <ulf.jasper@web.de> | ||
| 38 | |||
| 39 | * automated/newsticker-tests.el | ||
| 40 | (newsticker--group-manage-orphan-feeds): Use fset instead of flet. | ||
| 41 | |||
| 42 | * trunk/test/automated/newsticker-tests.el | ||
| 43 | (newsticker--group-manage-orphan-feeds): Prevent updating | ||
| 44 | newsticker treeview. Fixed bug#9763. | ||
| 45 | |||
| 46 | 2011-10-20 Glenn Morris <rgm@gnu.org> | ||
| 47 | |||
| 48 | * automated/vc-bzr.el (vc-bzr-test-bug9781): New test. | ||
| 49 | |||
| 50 | * automated/vc-bzr.el: New file. | ||
| 51 | |||
| 52 | 2011-10-15 Glenn Morris <rgm@gnu.org> | ||
| 53 | |||
| 54 | * automated/f90.el: New file. | ||
| 55 | |||
| 56 | 2011-09-27 Ulf Jasper <ulf.jasper@web.de> | ||
| 57 | |||
| 58 | * automated/newsticker-tests.el: Move newsticker-testsuite.el | ||
| 59 | to automated/newsticker-tests.el. Convert to ERT. | ||
| 60 | |||
| 61 | 2011-07-26 Ulf Jasper <ulf.jasper@web.de> | ||
| 62 | |||
| 63 | * automated/icalendar-tests.el (icalendar-tests--compare-strings): | ||
| 64 | Removed, simply use string=. | ||
| 65 | (icalendar--diarytime-to-isotime) | ||
| 66 | (icalendar--datetime-to-diary-date) | ||
| 67 | (icalendar--datestring-to-isodate) | ||
| 68 | (icalendar--format-ical-event) | ||
| 69 | (icalendar--parse-summary-and-rest) | ||
| 70 | (icalendar-tests--do-test-import) | ||
| 71 | (icalendar-tests--do-test-cycle): Change argument order of | ||
| 72 | string= to EXPECTED ACTUAL. | ||
| 73 | (icalendar--import-format-sample) | ||
| 74 | (icalendar--format-ical-event) | ||
| 75 | (icalendar-import-non-recurring) | ||
| 76 | (icalendar-import-rrule) | ||
| 77 | (icalendar-import-duration) | ||
| 78 | (icalendar-import-bug-6766) | ||
| 79 | (icalendar-real-world): Adjust to string= instead of | ||
| 80 | icalendar-tests--compare-strings. | ||
| 81 | (icalendar-import-multiple-vcalendars): New. | ||
| 82 | |||
| 1 | 2011-05-11 Teodor Zlatanov <tzz@lifelogs.com> | 83 | 2011-05-11 Teodor Zlatanov <tzz@lifelogs.com> |
| 2 | 84 | ||
| 3 | * automated/gnus-tests.el: Add wrapper for Gnus tests. | 85 | * automated/gnus-tests.el: Add wrapper for Gnus tests. |
| @@ -181,8 +263,8 @@ | |||
| 181 | 2010-02-19 Ulf Jasper <ulf.jasper@web.de> | 263 | 2010-02-19 Ulf Jasper <ulf.jasper@web.de> |
| 182 | 264 | ||
| 183 | * icalendar-testsuite.el | 265 | * icalendar-testsuite.el |
| 184 | (icalendar-testsuite--run-function-tests): Added new tests. | 266 | (icalendar-testsuite--run-function-tests): Add new tests. |
| 185 | (icalendar-testsuite--test-diarytime-to-isotime): Added another | 267 | (icalendar-testsuite--test-diarytime-to-isotime): Add another |
| 186 | testcase. | 268 | testcase. |
| 187 | (icalendar-testsuite--test-convert-ordinary-to-ical): New. | 269 | (icalendar-testsuite--test-convert-ordinary-to-ical): New. |
| 188 | (icalendar-testsuite--test-convert-weekly-to-ical): New. | 270 | (icalendar-testsuite--test-convert-weekly-to-ical): New. |
| @@ -207,14 +289,14 @@ | |||
| 207 | 2009-12-18 Ulf Jasper <ulf.jasper@web.de> | 289 | 2009-12-18 Ulf Jasper <ulf.jasper@web.de> |
| 208 | 290 | ||
| 209 | * icalendar-testsuite.el | 291 | * icalendar-testsuite.el |
| 210 | (icalendar-testsuite--run-function-tests): Added | 292 | (icalendar-testsuite--run-function-tests): Add |
| 211 | icalendar-testsuite--test-parse-vtimezone. | 293 | icalendar-testsuite--test-parse-vtimezone. |
| 212 | (icalendar-testsuite--test-parse-vtimezone): New. | 294 | (icalendar-testsuite--test-parse-vtimezone): New. |
| 213 | (icalendar-testsuite--do-test-cycle): Doc changes. | 295 | (icalendar-testsuite--do-test-cycle): Doc changes. |
| 214 | (icalendar-testsuite--run-real-world-tests): Removed trailing | 296 | (icalendar-testsuite--run-real-world-tests): Remove trailing |
| 215 | whitespace -- see change of icalendar--add-diary-entry in | 297 | whitespace -- see change of icalendar--add-diary-entry in |
| 216 | icalendar.el. | 298 | icalendar.el. |
| 217 | (icalendar-testsuite--run-cycle-tests): Re-enabled all tests. | 299 | (icalendar-testsuite--run-cycle-tests): Re-enable all tests. |
| 218 | 300 | ||
| 219 | 2009-09-30 Glenn Morris <rgm@gnu.org> | 301 | 2009-09-30 Glenn Morris <rgm@gnu.org> |
| 220 | 302 | ||
| @@ -235,12 +317,12 @@ | |||
| 235 | 2009-01-25 Ulf Jasper <ulf.jasper@web.de> | 317 | 2009-01-25 Ulf Jasper <ulf.jasper@web.de> |
| 236 | 318 | ||
| 237 | * icalendar-testsuite.el | 319 | * icalendar-testsuite.el |
| 238 | (icalendar-testsuite--run-function-tests): Added | 320 | (icalendar-testsuite--run-function-tests): |
| 239 | icalendar-testsuite--test-diarytime-to-isotime. | 321 | Add icalendar-testsuite--test-diarytime-to-isotime. |
| 240 | (icalendar-testsuite--test-parse-summary-and-rest): Adjusted to | 322 | (icalendar-testsuite--test-parse-summary-and-rest): Adjust to |
| 241 | recent icalendar fixes. | 323 | recent icalendar fixes. |
| 242 | (icalendar-testsuite--test-diarytime-to-isotime): New. | 324 | (icalendar-testsuite--test-diarytime-to-isotime): New. |
| 243 | (icalendar-testsuite--test-create-uid): Adjusted to recent | 325 | (icalendar-testsuite--test-create-uid): Adjust to recent |
| 244 | icalendar changes. | 326 | icalendar changes. |
| 245 | 327 | ||
| 246 | 2008-11-30 Shigeru Fukaya <shigeru.fukaya@gmail.com> | 328 | 2008-11-30 Shigeru Fukaya <shigeru.fukaya@gmail.com> |
| @@ -293,7 +375,7 @@ | |||
| 293 | ;; coding: utf-8 | 375 | ;; coding: utf-8 |
| 294 | ;; End: | 376 | ;; End: |
| 295 | 377 | ||
| 296 | Copyright (C) 2008-2011 Free Software Foundation, Inc. | 378 | Copyright (C) 2008-2012 Free Software Foundation, Inc. |
| 297 | 379 | ||
| 298 | This file is part of GNU Emacs. | 380 | This file is part of GNU Emacs. |
| 299 | 381 | ||
diff --git a/test/automated/Makefile.in b/test/automated/Makefile.in index b16c9721897..c07d5a1897d 100644 --- a/test/automated/Makefile.in +++ b/test/automated/Makefile.in | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | # Maintenance productions for the automated test directory | 1 | # Maintenance productions for the automated test directory |
| 2 | # Copyright (C) 2010-2011 Free Software Foundation, Inc. | 2 | # Copyright (C) 2010-2012 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | # This file is part of GNU Emacs. | 4 | # This file is part of GNU Emacs. |
| 5 | 5 | ||
diff --git a/test/automated/bytecomp-tests.el b/test/automated/bytecomp-tests.el index 45d5b19ee71..b7ec79fd51c 100644 --- a/test/automated/bytecomp-tests.el +++ b/test/automated/bytecomp-tests.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; bytecomp-testsuite.el | 1 | ;;; bytecomp-testsuite.el |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2008-2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2008-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Shigeru Fukaya <shigeru.fukaya@gmail.com> | 5 | ;; Author: Shigeru Fukaya <shigeru.fukaya@gmail.com> |
| 6 | ;; Created: November 2008 | 6 | ;; Created: November 2008 |
diff --git a/test/automated/comint-testsuite.el b/test/automated/comint-testsuite.el index 4b2d3896407..7317c107d59 100644 --- a/test/automated/comint-testsuite.el +++ b/test/automated/comint-testsuite.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; comint-testsuite.el | 1 | ;;; comint-testsuite.el |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2010-2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2010-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; This file is part of GNU Emacs. | 5 | ;; This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/test/automated/compile-tests.el b/test/automated/compile-tests.el index 1d9a266904c..ad36c4296b4 100644 --- a/test/automated/compile-tests.el +++ b/test/automated/compile-tests.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; compile-tests.el --- Test suite for font parsing. | 1 | ;;; compile-tests.el --- Test suite for font parsing. |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2011-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Chong Yidong <cyd@stupidchicken.com> | 5 | ;; Author: Chong Yidong <cyd@stupidchicken.com> |
| 6 | ;; Keywords: internal | 6 | ;; Keywords: internal |
| @@ -41,7 +41,7 @@ | |||
| 41 | 1 nil 17 "fplot.f") | 41 | 1 nil 17 "fplot.f") |
| 42 | ;; Ada & Mpatrol | 42 | ;; Ada & Mpatrol |
| 43 | ("foo.adb:61:11: [...] in call to size declared at foo.ads:11" | 43 | ("foo.adb:61:11: [...] in call to size declared at foo.ads:11" |
| 44 | 1 10 61 "foo.adb") | 44 | 1 11 61 "foo.adb") |
| 45 | ("foo.adb:61:11: [...] in call to size declared at foo.ads:11" | 45 | ("foo.adb:61:11: [...] in call to size declared at foo.ads:11" |
| 46 | 52 nil 11 "foo.ads") | 46 | 52 nil 11 "foo.ads") |
| 47 | (" 0x8008621 main+16 at error.c:17" | 47 | (" 0x8008621 main+16 at error.c:17" |
| @@ -55,7 +55,7 @@ | |||
| 55 | ("[javac] /src/DataBaseTestCase.java:49: warning: finally clause cannot complete normally" | 55 | ("[javac] /src/DataBaseTestCase.java:49: warning: finally clause cannot complete normally" |
| 56 | 13 nil 49 "/src/DataBaseTestCase.java") | 56 | 13 nil 49 "/src/DataBaseTestCase.java") |
| 57 | ("[jikes] foo.java:3:5:7:9: blah blah" | 57 | ("[jikes] foo.java:3:5:7:9: blah blah" |
| 58 | 14 (4 . 9) (3 . 7) "foo.java") | 58 | 14 (5 . 10) (3 . 7) "foo.java") |
| 59 | ;; bash | 59 | ;; bash |
| 60 | ("a.sh: line 1: ls-l: command not found" | 60 | ("a.sh: line 1: ls-l: command not found" |
| 61 | 1 nil 1 "a.sh") | 61 | 1 nil 1 "a.sh") |
| @@ -70,9 +70,9 @@ | |||
| 70 | 1 nil 68 "pong.c") | 70 | 1 nil 68 "pong.c") |
| 71 | ;; caml | 71 | ;; caml |
| 72 | ("File \"foobar.ml\", lines 5-8, characters 20-155: blah blah" | 72 | ("File \"foobar.ml\", lines 5-8, characters 20-155: blah blah" |
| 73 | 1 (19 . 155) (5 . 8) "foobar.ml") | 73 | 1 (20 . 156) (5 . 8) "foobar.ml") |
| 74 | ("File \"F:\\ocaml\\sorting.ml\", line 65, characters 2-145:" | 74 | ("File \"F:\\ocaml\\sorting.ml\", line 65, characters 2-145:\nWarning 26: unused variable equ." |
| 75 | 1 (1 . 145) 65 "F:\\ocaml\\sorting.ml") | 75 | 1 (2 . 146) 65 "F:\\ocaml\\sorting.ml") |
| 76 | ("File \"/usr/share/gdesklets/display/TargetGauge.py\", line 41, in add_children" | 76 | ("File \"/usr/share/gdesklets/display/TargetGauge.py\", line 41, in add_children" |
| 77 | 1 nil 41 "/usr/share/gdesklets/display/TargetGauge.py") | 77 | 1 nil 41 "/usr/share/gdesklets/display/TargetGauge.py") |
| 78 | ("File \\lib\\python\\Products\\PythonScripts\\PythonScript.py, line 302, in _exec" | 78 | ("File \\lib\\python\\Products\\PythonScripts\\PythonScript.py, line 302, in _exec" |
| @@ -83,13 +83,13 @@ | |||
| 83 | ("\"foo.f\", line 3: Error: syntax error near end of statement" | 83 | ("\"foo.f\", line 3: Error: syntax error near end of statement" |
| 84 | 1 nil 3 "foo.f") | 84 | 1 nil 3 "foo.f") |
| 85 | ("\"vvouch.c\", line 19.5: 1506-046 (S) Syntax error." | 85 | ("\"vvouch.c\", line 19.5: 1506-046 (S) Syntax error." |
| 86 | 1 4 19 "vvouch.c") | 86 | 1 5 19 "vvouch.c") |
| 87 | ("\"foo.c\", line 32 pos 1; (E) syntax error; unexpected symbol: \"lossage\"" | 87 | ("\"foo.c\", line 32 pos 1; (E) syntax error; unexpected symbol: \"lossage\"" |
| 88 | 1 0 32 "foo.c") | 88 | 1 1 32 "foo.c") |
| 89 | ("\"foo.adb\", line 2(11): warning: file name does not match ..." | 89 | ("\"foo.adb\", line 2(11): warning: file name does not match ..." |
| 90 | 1 10 2 "foo.adb") | 90 | 1 11 2 "foo.adb") |
| 91 | ("\"src/swapping.c\", line 30.34: 1506-342 (W) \"/*\" detected in comment." | 91 | ("\"src/swapping.c\", line 30.34: 1506-342 (W) \"/*\" detected in comment." |
| 92 | 1 33 30 "src/swapping.c") | 92 | 1 34 30 "src/swapping.c") |
| 93 | ;; cucumber | 93 | ;; cucumber |
| 94 | ("Scenario: undefined step # features/cucumber.feature:3" | 94 | ("Scenario: undefined step # features/cucumber.feature:3" |
| 95 | 29 nil 3 "features/cucumber.feature") | 95 | 29 nil 3 "features/cucumber.feature") |
| @@ -115,7 +115,7 @@ | |||
| 115 | ("Warning near line 10 file arrayclash.f: Module contains no executable" | 115 | ("Warning near line 10 file arrayclash.f: Module contains no executable" |
| 116 | 1 nil 10 "arrayclash.f") | 116 | 1 nil 10 "arrayclash.f") |
| 117 | ("Nonportable usage near line 31 col 9 file assign.f: mixed default and explicit" | 117 | ("Nonportable usage near line 31 col 9 file assign.f: mixed default and explicit" |
| 118 | 24 8 31 "assign.f") | 118 | 24 9 31 "assign.f") |
| 119 | ;; iar | 119 | ;; iar |
| 120 | ("\"foo.c\",3 Error[32]: Error message" | 120 | ("\"foo.c\",3 Error[32]: Error message" |
| 121 | 1 nil 3 "foo.c") | 121 | 1 nil 3 "foo.c") |
| @@ -123,11 +123,11 @@ | |||
| 123 | 1 nil 3 "foo.c") | 123 | 1 nil 3 "foo.c") |
| 124 | ;; ibm | 124 | ;; ibm |
| 125 | ("foo.c(2:0) : informational EDC0804: Function foo is not referenced." | 125 | ("foo.c(2:0) : informational EDC0804: Function foo is not referenced." |
| 126 | 1 -1 2 "foo.c") | 126 | 1 0 2 "foo.c") |
| 127 | ("foo.c(3:8) : warning EDC0833: Implicit return statement encountered." | 127 | ("foo.c(3:8) : warning EDC0833: Implicit return statement encountered." |
| 128 | 1 7 3 "foo.c") | 128 | 1 8 3 "foo.c") |
| 129 | ("foo.c(5:5) : error EDC0350: Syntax error." | 129 | ("foo.c(5:5) : error EDC0350: Syntax error." |
| 130 | 1 4 5 "foo.c") | 130 | 1 5 5 "foo.c") |
| 131 | ;; irix | 131 | ;; irix |
| 132 | ("ccom: Error: foo.c, line 2: syntax error" | 132 | ("ccom: Error: foo.c, line 2: syntax error" |
| 133 | 1 nil 2 "foo.c") | 133 | 1 nil 2 "foo.c") |
| @@ -163,7 +163,7 @@ | |||
| 163 | ("In file included from /usr/include/c++/3.3/backward/warn.h:4," | 163 | ("In file included from /usr/include/c++/3.3/backward/warn.h:4," |
| 164 | 1 nil 4 "/usr/include/c++/3.3/backward/warn.h") | 164 | 1 nil 4 "/usr/include/c++/3.3/backward/warn.h") |
| 165 | (" from /usr/include/c++/3.3/backward/iostream.h:31:0," | 165 | (" from /usr/include/c++/3.3/backward/iostream.h:31:0," |
| 166 | 1 -1 31 "/usr/include/c++/3.3/backward/iostream.h") | 166 | 1 0 31 "/usr/include/c++/3.3/backward/iostream.h") |
| 167 | (" from test_clt.cc:1:" | 167 | (" from test_clt.cc:1:" |
| 168 | 1 nil 1 "test_clt.cc") | 168 | 1 nil 1 "test_clt.cc") |
| 169 | ;; gnu | 169 | ;; gnu |
| @@ -173,15 +173,15 @@ | |||
| 173 | ("foo/bar.py:8: FutureWarning message" 1 nil 8 "foo/bar.py") | 173 | ("foo/bar.py:8: FutureWarning message" 1 nil 8 "foo/bar.py") |
| 174 | ("foo.py:8: RuntimeWarning message" 1 nil 8 "foo.py") | 174 | ("foo.py:8: RuntimeWarning message" 1 nil 8 "foo.py") |
| 175 | ("foo.c:8:I: message" 1 nil 8 "foo.c") | 175 | ("foo.c:8:I: message" 1 nil 8 "foo.c") |
| 176 | ("foo.c:8.23: note: message" 1 22 8 "foo.c") | 176 | ("foo.c:8.23: note: message" 1 23 8 "foo.c") |
| 177 | ("foo.c:8.23: info: message" 1 22 8 "foo.c") | 177 | ("foo.c:8.23: info: message" 1 23 8 "foo.c") |
| 178 | ("foo.c:8:23:information: message" 1 22 8 "foo.c") | 178 | ("foo.c:8:23:information: message" 1 23 8 "foo.c") |
| 179 | ("foo.c:8.23-45: Informational: message" 1 (22 . nil) (8 . 45) "foo.c") | 179 | ("foo.c:8.23-45: Informational: message" 1 (23 . nil) (8 . 45) "foo.c") |
| 180 | ("foo.c:8-23: message" 1 nil (8 . 23) "foo.c") | 180 | ("foo.c:8-23: message" 1 nil (8 . 23) "foo.c") |
| 181 | ("foo.c:8-45.3: message" 1 (nil . 3) (8 . 45) "foo.c") | 181 | ("foo.c:8-45.3: message" 1 (nil . 4) (8 . 45) "foo.c") |
| 182 | ("foo.c:8.23-9.1: message" 1 (22 . 1) (8 . 9) "foo.c") | 182 | ("foo.c:8.23-9.1: message" 1 (23 . 2) (8 . 9) "foo.c") |
| 183 | ("jade:dbcommon.dsl:133:17:E: missing argument for function call" | 183 | ("jade:dbcommon.dsl:133:17:E: missing argument for function call" |
| 184 | 1 16 133 "dbcommon.dsl") | 184 | 1 17 133 "dbcommon.dsl") |
| 185 | ("G:/cygwin/dev/build-myproj.xml:54: Compiler Adapter 'javac' can't be found." | 185 | ("G:/cygwin/dev/build-myproj.xml:54: Compiler Adapter 'javac' can't be found." |
| 186 | 1 nil 54 "G:/cygwin/dev/build-myproj.xml") | 186 | 1 nil 54 "G:/cygwin/dev/build-myproj.xml") |
| 187 | ("file:G:/cygwin/dev/build-myproj.xml:54: Compiler Adapter 'javac' can't be found." | 187 | ("file:G:/cygwin/dev/build-myproj.xml:54: Compiler Adapter 'javac' can't be found." |
| @@ -189,8 +189,8 @@ | |||
| 189 | ("{standard input}:27041: Warning: end of file not at end of a line; newline inserted" | 189 | ("{standard input}:27041: Warning: end of file not at end of a line; newline inserted" |
| 190 | 1 nil 27041 "{standard input}") | 190 | 1 nil 27041 "{standard input}") |
| 191 | ;; lcc | 191 | ;; lcc |
| 192 | ("E, file.cc(35,52) Illegal operation on pointers" 1 51 35 "file.cc") | 192 | ("E, file.cc(35,52) Illegal operation on pointers" 1 52 35 "file.cc") |
| 193 | ("W, file.cc(36,52) blah blah" 1 51 36 "file.cc") | 193 | ("W, file.cc(36,52) blah blah" 1 52 36 "file.cc") |
| 194 | ;; makepp | 194 | ;; makepp |
| 195 | ("makepp: Scanning `/foo/bar.c'" 19 nil nil "/foo/bar.c") | 195 | ("makepp: Scanning `/foo/bar.c'" 19 nil nil "/foo/bar.c") |
| 196 | ("makepp: warning: bla bla `/foo/bar.c' and `/foo/bar.h'" 27 nil nil "/foo/bar.c") | 196 | ("makepp: warning: bla bla `/foo/bar.c' and `/foo/bar.h'" 27 nil nil "/foo/bar.c") |
| @@ -198,7 +198,7 @@ | |||
| 198 | ("makepp: bla bla `/foo/bar.c' and `/foo/bar.h'" 35 nil nil "/foo/bar.h") | 198 | ("makepp: bla bla `/foo/bar.c' and `/foo/bar.h'" 35 nil nil "/foo/bar.h") |
| 199 | ;; maven | 199 | ;; maven |
| 200 | ("FooBar.java:[111,53] no interface expected here" | 200 | ("FooBar.java:[111,53] no interface expected here" |
| 201 | 1 52 111 "FooBar.java") | 201 | 1 53 111 "FooBar.java") |
| 202 | ;; mips-1 mips-2 | 202 | ;; mips-1 mips-2 |
| 203 | ("TrimMask (255) in solomon.c may be indistinguishable from TrimMasks (93) in solomo.c due to truncation" | 203 | ("TrimMask (255) in solomon.c may be indistinguishable from TrimMasks (93) in solomo.c due to truncation" |
| 204 | 11 nil 255 "solomon.c") | 204 | 11 nil 255 "solomon.c") |
| @@ -220,17 +220,17 @@ | |||
| 220 | 1 nil 120 "..\src\ctrl\lister.c") | 220 | 1 nil 120 "..\src\ctrl\lister.c") |
| 221 | ;; oracle | 221 | ;; oracle |
| 222 | ("Semantic error at line 528, column 5, file erosacqdb.pc:" | 222 | ("Semantic error at line 528, column 5, file erosacqdb.pc:" |
| 223 | 1 4 528 "erosacqdb.pc") | 223 | 1 5 528 "erosacqdb.pc") |
| 224 | ("Error at line 41, column 10 in file /usr/src/sb/ODBI_BHP.hpp" | 224 | ("Error at line 41, column 10 in file /usr/src/sb/ODBI_BHP.hpp" |
| 225 | 1 9 41 "/usr/src/sb/ODBI_BHP.hpp") | 225 | 1 10 41 "/usr/src/sb/ODBI_BHP.hpp") |
| 226 | ("PCC-02150: error at line 49, column 27 in file /usr/src/sb/ODBI_dxfgh.pc" | 226 | ("PCC-02150: error at line 49, column 27 in file /usr/src/sb/ODBI_dxfgh.pc" |
| 227 | 1 26 49 "/usr/src/sb/ODBI_dxfgh.pc") | 227 | 1 27 49 "/usr/src/sb/ODBI_dxfgh.pc") |
| 228 | ("PCC-00003: invalid SQL Identifier at column name in line 12 of file /usr/src/sb/ODBI_BHP.hpp" | 228 | ("PCC-00003: invalid SQL Identifier at column name in line 12 of file /usr/src/sb/ODBI_BHP.hpp" |
| 229 | 1 nil 12 "/usr/src/sb/ODBI_BHP.hpp") | 229 | 1 nil 12 "/usr/src/sb/ODBI_BHP.hpp") |
| 230 | ("PCC-00004: mismatched IF/ELSE/ENDIF block at line 27 in file /usr/src/sb/ODBI_BHP.hpp" | 230 | ("PCC-00004: mismatched IF/ELSE/ENDIF block at line 27 in file /usr/src/sb/ODBI_BHP.hpp" |
| 231 | 1 nil 27 "/usr/src/sb/ODBI_BHP.hpp") | 231 | 1 nil 27 "/usr/src/sb/ODBI_BHP.hpp") |
| 232 | ("PCC-02151: line 21 column 40 file /usr/src/sb/ODBI_BHP.hpp:" | 232 | ("PCC-02151: line 21 column 40 file /usr/src/sb/ODBI_BHP.hpp:" |
| 233 | 1 39 21 "/usr/src/sb/ODBI_BHP.hpp") | 233 | 1 40 21 "/usr/src/sb/ODBI_BHP.hpp") |
| 234 | ;; perl | 234 | ;; perl |
| 235 | ("syntax error at automake line 922, near \"':'\"" | 235 | ("syntax error at automake line 922, near \"':'\"" |
| 236 | 14 nil 922 "automake") | 236 | 14 nil 922 "automake") |
| @@ -262,9 +262,9 @@ | |||
| 262 | 1 nil 10 "examples/test-unit.rb") | 262 | 1 nil 10 "examples/test-unit.rb") |
| 263 | ;; rxp | 263 | ;; rxp |
| 264 | ("Error: Mismatched end tag: expected </geroup>, got </group>\nin unnamed entity at line 71 char 8 of file:///home/reto/test/group.xml" | 264 | ("Error: Mismatched end tag: expected </geroup>, got </group>\nin unnamed entity at line 71 char 8 of file:///home/reto/test/group.xml" |
| 265 | 1 7 71 "/home/reto/test/group.xml") | 265 | 1 8 71 "/home/reto/test/group.xml") |
| 266 | ("Warning: Start tag for undeclared element geroup\nin unnamed entity at line 4 char 8 of file:///home/reto/test/group.xml" | 266 | ("Warning: Start tag for undeclared element geroup\nin unnamed entity at line 4 char 8 of file:///home/reto/test/group.xml" |
| 267 | 1 7 4 "/home/reto/test/group.xml") | 267 | 1 8 4 "/home/reto/test/group.xml") |
| 268 | ;; sparc-pascal-file sparc-pascal-line sparc-pascal-example | 268 | ;; sparc-pascal-file sparc-pascal-line sparc-pascal-example |
| 269 | ("Thu May 14 10:46:12 1992 mom3.p:" | 269 | ("Thu May 14 10:46:12 1992 mom3.p:" |
| 270 | 1 nil nil "mom3.p") | 270 | 1 nil nil "mom3.p") |
| @@ -274,10 +274,10 @@ | |||
| 274 | ("cc-1070 cc: WARNING File = linkl.c, Line = 38" | 274 | ("cc-1070 cc: WARNING File = linkl.c, Line = 38" |
| 275 | 13 nil 38 "linkl.c") | 275 | 13 nil 38 "linkl.c") |
| 276 | ("cf90-113 f90comp: ERROR NSE, File = Hoved.f90, Line = 16, Column = 3" | 276 | ("cf90-113 f90comp: ERROR NSE, File = Hoved.f90, Line = 16, Column = 3" |
| 277 | 18 2 16 "Hoved.f90") | 277 | 18 3 16 "Hoved.f90") |
| 278 | ;; sun-ada | 278 | ;; sun-ada |
| 279 | ("/home3/xdhar/rcds_rc/main.a, line 361, char 6:syntax error: \",\" inserted" | 279 | ("/home3/xdhar/rcds_rc/main.a, line 361, char 6:syntax error: \",\" inserted" |
| 280 | 1 5 361 "/home3/xdhar/rcds_rc/main.a") | 280 | 1 6 361 "/home3/xdhar/rcds_rc/main.a") |
| 281 | ;; 4bsd | 281 | ;; 4bsd |
| 282 | ("/usr/src/foo/foo.c(8): warning: w may be used before set" | 282 | ("/usr/src/foo/foo.c(8): warning: w may be used before set" |
| 283 | 1 nil 8 "/usr/src/foo/foo.c") | 283 | 1 nil 8 "/usr/src/foo/foo.c") |
| @@ -300,7 +300,7 @@ | |||
| 300 | 1 nil 46 "t/foo.t") | 300 | 1 nil 46 "t/foo.t") |
| 301 | ;; weblint | 301 | ;; weblint |
| 302 | ("index.html (13:1) Unknown element <fdjsk>" | 302 | ("index.html (13:1) Unknown element <fdjsk>" |
| 303 | 1 0 13 "index.html")) | 303 | 1 1 13 "index.html")) |
| 304 | "List of tests for `compilation-error-regexp-alist'. | 304 | "List of tests for `compilation-error-regexp-alist'. |
| 305 | Each element has the form (STR POS COLUMN LINE FILENAME), where | 305 | Each element has the form (STR POS COLUMN LINE FILENAME), where |
| 306 | STR is an error string, POS is the position of the error in STR, | 306 | STR is an error string, POS is the position of the error in STR, |
diff --git a/test/automated/ert-tests.el b/test/automated/ert-tests.el index cea994f64b8..1778afea802 100644 --- a/test/automated/ert-tests.el +++ b/test/automated/ert-tests.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; ert-tests.el --- ERT's self-tests | 1 | ;;; ert-tests.el --- ERT's self-tests |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2007-2008, 2010-2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2007-2008, 2010-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Christian Ohler <ohler@gnu.org> | 5 | ;; Author: Christian Ohler <ohler@gnu.org> |
| 6 | 6 | ||
| @@ -228,7 +228,7 @@ failed or if there was a problem." | |||
| 228 | :form (error "Foo") | 228 | :form (error "Foo") |
| 229 | :condition (error "Foo") | 229 | :condition (error "Foo") |
| 230 | :fail-reason | 230 | :fail-reason |
| 231 | "the error signalled did not have the expected type")))))) | 231 | "the error signaled did not have the expected type")))))) |
| 232 | ;; Error of the expected type. | 232 | ;; Error of the expected type. |
| 233 | (let* ((error nil) | 233 | (let* ((error nil) |
| 234 | (test (make-ert-test | 234 | (test (make-ert-test |
| @@ -258,7 +258,7 @@ failed or if there was a problem." | |||
| 258 | :form (signal arith-error nil) | 258 | :form (signal arith-error nil) |
| 259 | :condition (arith-error) | 259 | :condition (arith-error) |
| 260 | :fail-reason | 260 | :fail-reason |
| 261 | "the error signalled did not have the expected type")))))) | 261 | "the error signaled did not have the expected type")))))) |
| 262 | (let ((test (make-ert-test | 262 | (let ((test (make-ert-test |
| 263 | :body (lambda () | 263 | :body (lambda () |
| 264 | (should-error (signal 'arith-error nil) | 264 | (should-error (signal 'arith-error nil) |
| @@ -275,7 +275,7 @@ failed or if there was a problem." | |||
| 275 | :form (signal arith-error nil) | 275 | :form (signal arith-error nil) |
| 276 | :condition (arith-error) | 276 | :condition (arith-error) |
| 277 | :fail-reason | 277 | :fail-reason |
| 278 | "the error signalled did not have the expected type")))))) | 278 | "the error signaled did not have the expected type")))))) |
| 279 | (let ((test (make-ert-test | 279 | (let ((test (make-ert-test |
| 280 | :body (lambda () | 280 | :body (lambda () |
| 281 | (should-error (signal 'singularity-error nil) | 281 | (should-error (signal 'singularity-error nil) |
| @@ -292,7 +292,7 @@ failed or if there was a problem." | |||
| 292 | :form (signal singularity-error nil) | 292 | :form (signal singularity-error nil) |
| 293 | :condition (singularity-error) | 293 | :condition (singularity-error) |
| 294 | :fail-reason | 294 | :fail-reason |
| 295 | "the error signalled was a subtype of the expected type"))))) | 295 | "the error signaled was a subtype of the expected type"))))) |
| 296 | )) | 296 | )) |
| 297 | 297 | ||
| 298 | (defmacro ert--test-my-list (&rest args) | 298 | (defmacro ert--test-my-list (&rest args) |
diff --git a/test/automated/ert-x-tests.el b/test/automated/ert-x-tests.el index ff056b40b36..bb05608e418 100644 --- a/test/automated/ert-x-tests.el +++ b/test/automated/ert-x-tests.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; ert-x-tests.el --- Tests for ert-x.el | 1 | ;;; ert-x-tests.el --- Tests for ert-x.el |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2008, 2010-2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2008, 2010-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Phil Hagelberg | 5 | ;; Author: Phil Hagelberg |
| 6 | ;; Christian Ohler <ohler@gnu.org> | 6 | ;; Christian Ohler <ohler@gnu.org> |
diff --git a/test/automated/f90.el b/test/automated/f90.el new file mode 100644 index 00000000000..25b77f07ad3 --- /dev/null +++ b/test/automated/f90.el | |||
| @@ -0,0 +1,158 @@ | |||
| 1 | ;;; f90.el --- tests for progmodes/f90.el | ||
| 2 | |||
| 3 | ;; Copyright (C) 2011-2012 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Glenn Morris <rgm@gnu.org> | ||
| 6 | |||
| 7 | ;; This file is part of GNU Emacs. | ||
| 8 | |||
| 9 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 10 | ;; it under the terms of the GNU General Public License as published by | ||
| 11 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 12 | ;; (at your option) any later version. | ||
| 13 | |||
| 14 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 15 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | ;; GNU General Public License for more details. | ||
| 18 | |||
| 19 | ;; You should have received a copy of the GNU General Public License | ||
| 20 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 21 | |||
| 22 | ;;; Commentary: | ||
| 23 | |||
| 24 | ;; This file does not have "test" in the name, because it lives under | ||
| 25 | ;; a test/ directory, so that would be superfluous. | ||
| 26 | |||
| 27 | ;;; Code: | ||
| 28 | |||
| 29 | (require 'ert) | ||
| 30 | (require 'f90) | ||
| 31 | |||
| 32 | (defconst f90-test-indent "\ | ||
| 33 | !! Comment before code. | ||
| 34 | !!! Comments before code. | ||
| 35 | #preprocessor before code | ||
| 36 | |||
| 37 | program progname | ||
| 38 | |||
| 39 | implicit none | ||
| 40 | |||
| 41 | integer :: i | ||
| 42 | |||
| 43 | !! Comment. | ||
| 44 | |||
| 45 | do i = 1, 10 | ||
| 46 | |||
| 47 | #preprocessor | ||
| 48 | |||
| 49 | !! Comment. | ||
| 50 | if ( i % 2 == 0 ) then | ||
| 51 | !! Comment. | ||
| 52 | cycle | ||
| 53 | else | ||
| 54 | write(*,*) i | ||
| 55 | end if | ||
| 56 | end do | ||
| 57 | |||
| 58 | !!! Comment. | ||
| 59 | |||
| 60 | end program progname | ||
| 61 | " | ||
| 62 | "Test string for F90 indentation.") | ||
| 63 | |||
| 64 | (ert-deftest f90-test-indent () | ||
| 65 | "Test F90 indentation." | ||
| 66 | (with-temp-buffer | ||
| 67 | (f90-mode) | ||
| 68 | (insert f90-test-indent) | ||
| 69 | (indent-rigidly (point-min) (point-max) -999) | ||
| 70 | (f90-indent-region (point-min) (point-max)) | ||
| 71 | (should (string-equal (buffer-string) f90-test-indent)))) | ||
| 72 | |||
| 73 | (ert-deftest f90-test-bug3729 () | ||
| 74 | "Test for http://debbugs.gnu.org/3729 ." | ||
| 75 | :expected-result :failed | ||
| 76 | (with-temp-buffer | ||
| 77 | (f90-mode) | ||
| 78 | (insert "!! Comment | ||
| 79 | |||
| 80 | include \"file.f90\" | ||
| 81 | |||
| 82 | subroutine test (x) | ||
| 83 | real x | ||
| 84 | x = x+1. | ||
| 85 | return | ||
| 86 | end subroutine test") | ||
| 87 | (goto-char (point-min)) | ||
| 88 | (forward-line 2) | ||
| 89 | (f90-indent-subprogram) | ||
| 90 | (should (= 0 (current-indentation))))) | ||
| 91 | |||
| 92 | (ert-deftest f90-test-bug3730 () | ||
| 93 | "Test for http://debbugs.gnu.org/3730 ." | ||
| 94 | (with-temp-buffer | ||
| 95 | (f90-mode) | ||
| 96 | (insert "a" ) | ||
| 97 | (move-to-column 68 t) | ||
| 98 | (insert "(/ x /)") | ||
| 99 | (f90-do-auto-fill) | ||
| 100 | (beginning-of-line) | ||
| 101 | (skip-chars-forward "[ \t]") | ||
| 102 | (should (equal "&(/" (buffer-substring (point) (+ 3 (point))))))) | ||
| 103 | |||
| 104 | ;; TODO bug#5593 | ||
| 105 | |||
| 106 | (ert-deftest f90-test-bug8691 () | ||
| 107 | "Test for http://debbugs.gnu.org/8691 ." | ||
| 108 | (with-temp-buffer | ||
| 109 | (f90-mode) | ||
| 110 | (insert "module modname | ||
| 111 | type, bind(c) :: type1 | ||
| 112 | integer :: part1 | ||
| 113 | end type type1 | ||
| 114 | end module modname") | ||
| 115 | (f90-indent-subprogram) | ||
| 116 | (forward-line -1) | ||
| 117 | (should (= 2 (current-indentation))))) | ||
| 118 | |||
| 119 | ;; TODO bug#8812 | ||
| 120 | |||
| 121 | (ert-deftest f90-test-bug8820 () | ||
| 122 | "Test for http://debbugs.gnu.org/8820 ." | ||
| 123 | (with-temp-buffer | ||
| 124 | (f90-mode) | ||
| 125 | (should (eq (char-syntax ?%) (string-to-char "."))))) | ||
| 126 | |||
| 127 | (ert-deftest f90-test-bug9553a () | ||
| 128 | "Test for http://debbugs.gnu.org/9553 ." | ||
| 129 | (with-temp-buffer | ||
| 130 | (f90-mode) | ||
| 131 | (insert "!!!") | ||
| 132 | (dotimes (_i 20) (insert " aaaa")) | ||
| 133 | (f90-do-auto-fill) | ||
| 134 | (beginning-of-line) | ||
| 135 | ;; This gives a more informative failure than looking-at. | ||
| 136 | (should (equal "!!! a" (buffer-substring (point) (+ 5 (point))))))) | ||
| 137 | |||
| 138 | (ert-deftest f90-test-bug9553b () | ||
| 139 | "Test for http://debbugs.gnu.org/9553 ." | ||
| 140 | (with-temp-buffer | ||
| 141 | (f90-mode) | ||
| 142 | (insert "!!!") | ||
| 143 | (dotimes (_i 13) (insert " aaaa")) | ||
| 144 | (insert "a, aaaa") | ||
| 145 | (f90-do-auto-fill) | ||
| 146 | (beginning-of-line) | ||
| 147 | (should (equal "!!! a" (buffer-substring (point) (+ 5 (point))))))) | ||
| 148 | |||
| 149 | (ert-deftest f90-test-bug9690 () | ||
| 150 | "Test for http://debbugs.gnu.org/9690 ." | ||
| 151 | (with-temp-buffer | ||
| 152 | (f90-mode) | ||
| 153 | (insert "#include \"foo.h\"") | ||
| 154 | (f90-indent-line) | ||
| 155 | (should (= 0 (current-indentation))))) | ||
| 156 | |||
| 157 | |||
| 158 | ;;; f90.el ends here | ||
diff --git a/test/automated/font-parse-tests.el b/test/automated/font-parse-tests.el index 5ba8ad2be32..6aeaee4adce 100644 --- a/test/automated/font-parse-tests.el +++ b/test/automated/font-parse-tests.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; font-parse-tests.el --- Test suite for font parsing. | 1 | ;;; font-parse-tests.el --- Test suite for font parsing. |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2011-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Chong Yidong <cyd@stupidchicken.com> | 5 | ;; Author: Chong Yidong <cyd@stupidchicken.com> |
| 6 | ;; Keywords: internal | 6 | ;; Keywords: internal |
diff --git a/test/automated/gnus-tests.el b/test/automated/gnus-tests.el index f5742261d5b..3b5340bcdd3 100644 --- a/test/automated/gnus-tests.el +++ b/test/automated/gnus-tests.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; gnus-tests.el --- Wrapper for the Gnus tests | 1 | ;;; gnus-tests.el --- Wrapper for the Gnus tests |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2011-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Teodor Zlatanov <tzz@lifelogs.com> | 5 | ;; Author: Teodor Zlatanov <tzz@lifelogs.com> |
| 6 | 6 | ||
diff --git a/test/automated/icalendar-tests.el b/test/automated/icalendar-tests.el index d586230f642..503ea22d2b8 100644 --- a/test/automated/icalendar-tests.el +++ b/test/automated/icalendar-tests.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;; icalendar-tests.el --- Test suite for icalendar.el | 1 | ;; icalendar-tests.el --- Test suite for icalendar.el |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2005, 2008-2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2005, 2008-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Ulf Jasper <ulf.jasper@web.de> | 5 | ;; Author: Ulf Jasper <ulf.jasper@web.de> |
| 6 | ;; Created: March 2005 | 6 | ;; Created: March 2005 |
| @@ -39,7 +39,7 @@ | |||
| 39 | ;; ====================================================================== | 39 | ;; ====================================================================== |
| 40 | 40 | ||
| 41 | (defun icalendar-tests--get-ical-event (ical-string) | 41 | (defun icalendar-tests--get-ical-event (ical-string) |
| 42 | "Return icalendar event for ICAL-STRING." | 42 | "Return iCalendar event for ICAL-STRING." |
| 43 | (save-excursion | 43 | (save-excursion |
| 44 | (with-temp-buffer | 44 | (with-temp-buffer |
| 45 | (insert ical-string) | 45 | (insert ical-string) |
| @@ -51,35 +51,6 @@ | |||
| 51 | (replace-regexp-in-string "[ \t\n]+\\'" "" | 51 | (replace-regexp-in-string "[ \t\n]+\\'" "" |
| 52 | (replace-regexp-in-string "\\`[ \t\n]+" "" string))) | 52 | (replace-regexp-in-string "\\`[ \t\n]+" "" string))) |
| 53 | 53 | ||
| 54 | (defun icalendar-tests--compare-strings (str1 str2) | ||
| 55 | "Compare strings STR1 and STR2. | ||
| 56 | Return t if strings are equal, else return substring indicating first difference. | ||
| 57 | FIXME: make this a little smarter." | ||
| 58 | (let* ((s1 (icalendar-tests--trim str1)) | ||
| 59 | (s2 (icalendar-tests--trim str2)) | ||
| 60 | (result (compare-strings s1 0 nil s2 0 nil)) | ||
| 61 | (len (length str2))) | ||
| 62 | (if (numberp result) | ||
| 63 | (if (> result 0) | ||
| 64 | (concat "..." (substring str2 (- result 1) | ||
| 65 | (min len (+ (- result 1) 3))) "...") | ||
| 66 | (concat "..." (substring str2 (- (+ result 1)) | ||
| 67 | (min len (+ (- (+ result 1)) 3))) "...")) | ||
| 68 | t))) | ||
| 69 | |||
| 70 | (ert-deftest icalendar-tests--compare-strings () | ||
| 71 | "Test icalendar-tests--compare-strings." | ||
| 72 | (should (equal t (icalendar-tests--compare-strings " abcde" "abcde "))) | ||
| 73 | (should | ||
| 74 | (string= "...def..." | ||
| 75 | (icalendar-tests--compare-strings "abcxe" "abcdefghijklmn"))) | ||
| 76 | (should (string= "...xe..." | ||
| 77 | (icalendar-tests--compare-strings "abcde" "abcxe"))) | ||
| 78 | (should (string= "...ddd..." | ||
| 79 | (icalendar-tests--compare-strings "abc" "abcdddddd"))) | ||
| 80 | (should (string= "......" | ||
| 81 | (icalendar-tests--compare-strings "abcdefghij" "abc")))) | ||
| 82 | |||
| 83 | ;; ====================================================================== | 54 | ;; ====================================================================== |
| 84 | ;; Tests of functions | 55 | ;; Tests of functions |
| 85 | ;; ====================================================================== | 56 | ;; ====================================================================== |
| @@ -248,7 +219,7 @@ END:VTIMEZONE | |||
| 248 | (should (string= "\nDTSTART;VALUE=DATE:20100215\nDTEND;VALUE=DATE:20100216" | 219 | (should (string= "\nDTSTART;VALUE=DATE:20100215\nDTEND;VALUE=DATE:20100216" |
| 249 | (car result))) | 220 | (car result))) |
| 250 | (should (string= "subject" (cadr result))) | 221 | (should (string= "subject" (cadr result))) |
| 251 | 222 | ||
| 252 | ;; with time | 223 | ;; with time |
| 253 | (setq result (icalendar--convert-ordinary-to-ical | 224 | (setq result (icalendar--convert-ordinary-to-ical |
| 254 | "&?" "&2010 2 15 12:34-23:45 s")) | 225 | "&?" "&2010 2 15 12:34-23:45 s")) |
| @@ -269,85 +240,85 @@ END:VTIMEZONE | |||
| 269 | 240 | ||
| 270 | (ert-deftest icalendar--diarytime-to-isotime () | 241 | (ert-deftest icalendar--diarytime-to-isotime () |
| 271 | "Test method for `icalendar--diarytime-to-isotime'." | 242 | "Test method for `icalendar--diarytime-to-isotime'." |
| 272 | (should (string= (icalendar--diarytime-to-isotime "01:15" "") | 243 | (should (string= "T011500" |
| 273 | "T011500")) | 244 | (icalendar--diarytime-to-isotime "01:15" ""))) |
| 274 | (should (string= (icalendar--diarytime-to-isotime "1:15" "") | 245 | (should (string= "T011500" |
| 275 | "T011500")) | 246 | (icalendar--diarytime-to-isotime "1:15" ""))) |
| 276 | (should (string= (icalendar--diarytime-to-isotime "0:01" "") | 247 | (should (string= "T000100" |
| 277 | "T000100")) | 248 | (icalendar--diarytime-to-isotime "0:01" ""))) |
| 278 | (should (string= (icalendar--diarytime-to-isotime "0100" "") | 249 | (should (string= "T010000" |
| 279 | "T010000")) | 250 | (icalendar--diarytime-to-isotime "0100" ""))) |
| 280 | (should (string= (icalendar--diarytime-to-isotime "0100" "am") | 251 | (should (string= "T010000" |
| 281 | "T010000")) | 252 | (icalendar--diarytime-to-isotime "0100" "am"))) |
| 282 | (should (string= (icalendar--diarytime-to-isotime "0100" "pm") | 253 | (should (string= "T130000" |
| 283 | "T130000")) | 254 | (icalendar--diarytime-to-isotime "0100" "pm"))) |
| 284 | (should (string= (icalendar--diarytime-to-isotime "1200" "") | 255 | (should (string= "T120000" |
| 285 | "T120000")) | 256 | (icalendar--diarytime-to-isotime "1200" ""))) |
| 286 | (should (string= (icalendar--diarytime-to-isotime "17:17" "") | 257 | (should (string= "T171700" |
| 287 | "T171700")) | 258 | (icalendar--diarytime-to-isotime "17:17" ""))) |
| 288 | (should (string= (icalendar--diarytime-to-isotime "1200" "am") | 259 | (should (string= "T000000" |
| 289 | "T000000")) | 260 | (icalendar--diarytime-to-isotime "1200" "am"))) |
| 290 | (should (string= (icalendar--diarytime-to-isotime "1201" "am") | 261 | (should (string= "T000100" |
| 291 | "T000100")) | 262 | (icalendar--diarytime-to-isotime "1201" "am"))) |
| 292 | (should (string= (icalendar--diarytime-to-isotime "1259" "am") | 263 | (should (string= "T005900" |
| 293 | "T005900")) | 264 | (icalendar--diarytime-to-isotime "1259" "am"))) |
| 294 | (should (string= (icalendar--diarytime-to-isotime "1200" "pm") | 265 | (should (string= "T120000" |
| 295 | "T120000")) | 266 | (icalendar--diarytime-to-isotime "1200" "pm"))) |
| 296 | (should (string= (icalendar--diarytime-to-isotime "1201" "pm") | 267 | (should (string= "T120100" |
| 297 | "T120100")) | 268 | (icalendar--diarytime-to-isotime "1201" "pm"))) |
| 298 | (should (string= (icalendar--diarytime-to-isotime "1259" "pm") | 269 | (should (string= "T125900" |
| 299 | "T125900"))) | 270 | (icalendar--diarytime-to-isotime "1259" "pm")))) |
| 300 | 271 | ||
| 301 | (ert-deftest icalendar--datetime-to-diary-date () | 272 | (ert-deftest icalendar--datetime-to-diary-date () |
| 302 | "Test method for `icalendar--datetime-to-diary-date'." | 273 | "Test method for `icalendar--datetime-to-diary-date'." |
| 303 | (let* ((datetime '(59 59 23 31 12 2008)) | 274 | (let* ((datetime '(59 59 23 31 12 2008)) |
| 304 | (calendar-date-style 'iso)) | 275 | (calendar-date-style 'iso)) |
| 305 | (should (string= (icalendar--datetime-to-diary-date datetime) | 276 | (should (string= "2008 12 31" |
| 306 | "2008 12 31")) | 277 | (icalendar--datetime-to-diary-date datetime))) |
| 307 | (setq calendar-date-style 'european) | 278 | (setq calendar-date-style 'european) |
| 308 | (should (string= (icalendar--datetime-to-diary-date datetime) | 279 | (should (string= "31 12 2008" |
| 309 | "31 12 2008")) | 280 | (icalendar--datetime-to-diary-date datetime))) |
| 310 | (setq calendar-date-style 'american) | 281 | (setq calendar-date-style 'american) |
| 311 | (should (string= (icalendar--datetime-to-diary-date datetime) | 282 | (should (string= "12 31 2008" |
| 312 | "12 31 2008")))) | 283 | (icalendar--datetime-to-diary-date datetime))))) |
| 313 | 284 | ||
| 314 | (ert-deftest icalendar--datestring-to-isodate () | 285 | (ert-deftest icalendar--datestring-to-isodate () |
| 315 | "Test method for `icalendar--datestring-to-isodate'." | 286 | "Test method for `icalendar--datestring-to-isodate'." |
| 316 | (let ((calendar-date-style 'iso)) | 287 | (let ((calendar-date-style 'iso)) |
| 317 | ;; numeric iso | 288 | ;; numeric iso |
| 318 | (should (string= (icalendar--datestring-to-isodate "2008 05 11") | 289 | (should (string= "20080511" |
| 319 | "20080511")) | 290 | (icalendar--datestring-to-isodate "2008 05 11"))) |
| 320 | (should (string= (icalendar--datestring-to-isodate "2008 05 31") | 291 | (should (string= "20080531" |
| 321 | "20080531")) | 292 | (icalendar--datestring-to-isodate "2008 05 31"))) |
| 322 | (should (string= (icalendar--datestring-to-isodate "2008 05 31" 2) | 293 | (should (string= "20080602" |
| 323 | "20080602")) | 294 | (icalendar--datestring-to-isodate "2008 05 31" 2))) |
| 324 | 295 | ||
| 325 | ;; numeric european | 296 | ;; numeric european |
| 326 | (setq calendar-date-style 'european) | 297 | (setq calendar-date-style 'european) |
| 327 | (should (string= (icalendar--datestring-to-isodate "11 05 2008") | 298 | (should (string= "20080511" |
| 328 | "20080511")) | 299 | (icalendar--datestring-to-isodate "11 05 2008"))) |
| 329 | (should (string= (icalendar--datestring-to-isodate "31 05 2008") | 300 | (should (string= "20080531" |
| 330 | "20080531")) | 301 | (icalendar--datestring-to-isodate "31 05 2008"))) |
| 331 | (should (string= (icalendar--datestring-to-isodate "31 05 2008" 2) | 302 | (should (string= "20080602" |
| 332 | "20080602")) | 303 | (icalendar--datestring-to-isodate "31 05 2008" 2))) |
| 333 | 304 | ||
| 334 | ;; numeric american | 305 | ;; numeric american |
| 335 | (setq calendar-date-style 'american) | 306 | (setq calendar-date-style 'american) |
| 336 | (should (string= (icalendar--datestring-to-isodate "11 05 2008") | 307 | (should (string= "20081105" |
| 337 | "20081105")) | 308 | (icalendar--datestring-to-isodate "11 05 2008"))) |
| 338 | (should (string= (icalendar--datestring-to-isodate "12 30 2008") | 309 | (should (string= "20081230" |
| 339 | "20081230")) | 310 | (icalendar--datestring-to-isodate "12 30 2008"))) |
| 340 | (should (string= (icalendar--datestring-to-isodate "12 30 2008" 2) | 311 | (should (string= "20090101" |
| 341 | "20090101")) | 312 | (icalendar--datestring-to-isodate "12 30 2008" 2))) |
| 342 | 313 | ||
| 343 | ;; non-numeric | 314 | ;; non-numeric |
| 344 | (setq calendar-date-style nil) ;not necessary for conversion | 315 | (setq calendar-date-style nil) ;not necessary for conversion |
| 345 | (should (string= (icalendar--datestring-to-isodate "Nov 05 2008") | 316 | (should (string= "20081105" |
| 346 | "20081105")) | 317 | (icalendar--datestring-to-isodate "Nov 05 2008"))) |
| 347 | (should (string= (icalendar--datestring-to-isodate "05 Nov 2008") | 318 | (should (string= "20081105" |
| 348 | "20081105")) | 319 | (icalendar--datestring-to-isodate "05 Nov 2008"))) |
| 349 | (should (string= (icalendar--datestring-to-isodate "2008 Nov 05") | 320 | (should (string= "20081105" |
| 350 | "20081105")))) | 321 | (icalendar--datestring-to-isodate "2008 Nov 05"))))) |
| 351 | 322 | ||
| 352 | (ert-deftest icalendar--first-weekday-of-year () | 323 | (ert-deftest icalendar--first-weekday-of-year () |
| 353 | "Test method for `icalendar-first-weekday-of-year'." | 324 | "Test method for `icalendar-first-weekday-of-year'." |
| @@ -363,7 +334,9 @@ END:VTIMEZONE | |||
| 363 | 334 | ||
| 364 | (ert-deftest icalendar--import-format-sample () | 335 | (ert-deftest icalendar--import-format-sample () |
| 365 | "Test method for `icalendar-import-format-sample'." | 336 | "Test method for `icalendar-import-format-sample'." |
| 366 | (should (string= (icalendar-import-format-sample | 337 | (should (string= (concat "SUMMARY=`a' DESCRIPTION=`b' LOCATION=`c' " |
| 338 | "ORGANIZER=`d' STATUS=`' URL=`' CLASS=`'") | ||
| 339 | (icalendar-import-format-sample | ||
| 367 | (icalendar-tests--get-ical-event "BEGIN:VEVENT | 340 | (icalendar-tests--get-ical-event "BEGIN:VEVENT |
| 368 | DTSTAMP:20030509T043439Z | 341 | DTSTAMP:20030509T043439Z |
| 369 | DTSTART:20030509T103000 | 342 | DTSTART:20030509T103000 |
| @@ -373,9 +346,7 @@ LOCATION:c | |||
| 373 | DTEND:20030509T153000 | 346 | DTEND:20030509T153000 |
| 374 | DESCRIPTION:b | 347 | DESCRIPTION:b |
| 375 | END:VEVENT | 348 | END:VEVENT |
| 376 | ")) | 349 | "))))) |
| 377 | (concat "SUMMARY=`a' DESCRIPTION=`b' LOCATION=`c' " | ||
| 378 | "ORGANIZER=`d' STATUS=`' URL=`' CLASS=`'")))) | ||
| 379 | 350 | ||
| 380 | (ert-deftest icalendar--format-ical-event () | 351 | (ert-deftest icalendar--format-ical-event () |
| 381 | "Test `icalendar--format-ical-event'." | 352 | "Test `icalendar--format-ical-event'." |
| @@ -397,12 +368,11 @@ DTEND:20030509T153000 | |||
| 397 | DESCRIPTION:des | 368 | DESCRIPTION:des |
| 398 | END:VEVENT | 369 | END:VEVENT |
| 399 | "))) | 370 | "))) |
| 400 | (should (string= (icalendar--format-ical-event event) | 371 | (should (string= "SUM sum DES des LOC loc ORG org" |
| 401 | "SUM sum DES des LOC loc ORG org")) | 372 | (icalendar--format-ical-event event))) |
| 402 | (setq icalendar-import-format (lambda (&rest ignore) | 373 | (setq icalendar-import-format (lambda (&rest ignore) |
| 403 | "helloworld")) | 374 | "helloworld")) |
| 404 | (should (string= (icalendar--format-ical-event event) | 375 | (should (string= "helloworld" (icalendar--format-ical-event event))) |
| 405 | "helloworld")) | ||
| 406 | (setq icalendar-import-format | 376 | (setq icalendar-import-format |
| 407 | (lambda (e) | 377 | (lambda (e) |
| 408 | (format "-%s-%s-%s-%s-%s-%s-%s-" | 378 | (format "-%s-%s-%s-%s-%s-%s-%s-" |
| @@ -413,8 +383,8 @@ END:VEVENT | |||
| 413 | (icalendar--get-event-property event 'STATUS) | 383 | (icalendar--get-event-property event 'STATUS) |
| 414 | (icalendar--get-event-property event 'URL) | 384 | (icalendar--get-event-property event 'URL) |
| 415 | (icalendar--get-event-property event 'CLASS)))) | 385 | (icalendar--get-event-property event 'CLASS)))) |
| 416 | (should (string= (icalendar--format-ical-event event) | 386 | (should (string= "-sum-des-loc-org-nil-nil-nil-" |
| 417 | "-sum-des-loc-org-nil-nil-nil-")))) | 387 | (icalendar--format-ical-event event))))) |
| 418 | 388 | ||
| 419 | (ert-deftest icalendar--parse-summary-and-rest () | 389 | (ert-deftest icalendar--parse-summary-and-rest () |
| 420 | "Test `icalendar--parse-summary-and-rest'." | 390 | "Test `icalendar--parse-summary-and-rest'." |
| @@ -428,15 +398,15 @@ END:VEVENT | |||
| 428 | (icalendar-import-format-class " CLA %s") | 398 | (icalendar-import-format-class " CLA %s") |
| 429 | (result)) | 399 | (result)) |
| 430 | (setq result (icalendar--parse-summary-and-rest "SUM sum ORG org")) | 400 | (setq result (icalendar--parse-summary-and-rest "SUM sum ORG org")) |
| 431 | (should (string= (cdr (assoc 'org result)) "org")) | 401 | (should (string= "org" (cdr (assoc 'org result)))) |
| 432 | 402 | ||
| 433 | (setq result (icalendar--parse-summary-and-rest | 403 | (setq result (icalendar--parse-summary-and-rest |
| 434 | "SUM sum DES des LOC loc ORG org STA sta URL url CLA cla")) | 404 | "SUM sum DES des LOC loc ORG org STA sta URL url CLA cla")) |
| 435 | (should (string= (cdr (assoc 'des result)) "des")) | 405 | (should (string= "des" (cdr (assoc 'des result)))) |
| 436 | (should (string= (cdr (assoc 'loc result)) "loc")) | 406 | (should (string= "loc" (cdr (assoc 'loc result)))) |
| 437 | (should (string= (cdr (assoc 'org result)) "org")) | 407 | (should (string= "org" (cdr (assoc 'org result)))) |
| 438 | (should (string= (cdr (assoc 'sta result)) "sta")) | 408 | (should (string= "sta" (cdr (assoc 'sta result)))) |
| 439 | (should (string= (cdr (assoc 'cla result)) "cla")) | 409 | (should (string= "cla" (cdr (assoc 'cla result)))) |
| 440 | 410 | ||
| 441 | (setq icalendar-import-format (lambda () "Hello world")) | 411 | (setq icalendar-import-format (lambda () "Hello world")) |
| 442 | (setq result (icalendar--parse-summary-and-rest | 412 | (setq result (icalendar--parse-summary-and-rest |
| @@ -454,7 +424,7 @@ END:VEVENT | |||
| 454 | Argument INPUT-ISO iso style diary string. | 424 | Argument INPUT-ISO iso style diary string. |
| 455 | Argument INPUT-EUROPEAN european style diary string. | 425 | Argument INPUT-EUROPEAN european style diary string. |
| 456 | Argument INPUT-AMERICAN american style diary string. | 426 | Argument INPUT-AMERICAN american style diary string. |
| 457 | Argument EXPECTED-OUTPUT expected icalendar result string. | 427 | Argument EXPECTED-OUTPUT expected iCalendar result string. |
| 458 | 428 | ||
| 459 | European style input data must use german month names. American | 429 | European style input data must use german month names. American |
| 460 | and ISO style input data must use english month names." | 430 | and ISO style input data must use english month names." |
| @@ -497,7 +467,7 @@ and ISO style input data must use english month names." | |||
| 497 | (defun icalendar-tests--do-test-export (input expected-output) | 467 | (defun icalendar-tests--do-test-export (input expected-output) |
| 498 | "Actually perform export test. | 468 | "Actually perform export test. |
| 499 | Argument INPUT input diary string. | 469 | Argument INPUT input diary string. |
| 500 | Argument EXPECTED-OUTPUT expected icalendar result string." | 470 | Argument EXPECTED-OUTPUT expected iCalendar result string." |
| 501 | (let ((temp-file (make-temp-file "icalendar-tests-ics"))) | 471 | (let ((temp-file (make-temp-file "icalendar-tests-ics"))) |
| 502 | (unwind-protect | 472 | (unwind-protect |
| 503 | (progn | 473 | (progn |
| @@ -738,12 +708,10 @@ Argument INPUT input icalendar string. | |||
| 738 | Argument EXPECTED-OUTPUT expected diary string." | 708 | Argument EXPECTED-OUTPUT expected diary string." |
| 739 | (let ((temp-file (make-temp-file "icalendar-test-diary"))) | 709 | (let ((temp-file (make-temp-file "icalendar-test-diary"))) |
| 740 | (icalendar-import-buffer temp-file t t) | 710 | (icalendar-import-buffer temp-file t t) |
| 741 | (unwind-protect | 711 | (save-excursion |
| 742 | (save-excursion | 712 | (find-file temp-file) |
| 743 | (find-file temp-file) | 713 | (let ((result (buffer-substring-no-properties (point-min) (point-max)))) |
| 744 | (let ((result (buffer-substring-no-properties (point-min) (point-max)))) | 714 | (should (string= expected-output result))) |
| 745 | (should (icalendar-tests--compare-strings result | ||
| 746 | expected-output)))) | ||
| 747 | (kill-buffer (find-buffer-visiting temp-file)) | 715 | (kill-buffer (find-buffer-visiting temp-file)) |
| 748 | (delete-file temp-file)))) | 716 | (delete-file temp-file)))) |
| 749 | 717 | ||
| @@ -753,23 +721,22 @@ Argument EXPECTED-OUTPUT expected diary string." | |||
| 753 | "SUMMARY:non-recurring | 721 | "SUMMARY:non-recurring |
| 754 | DTSTART;VALUE=DATE-TIME:20030919T090000 | 722 | DTSTART;VALUE=DATE-TIME:20030919T090000 |
| 755 | DTEND;VALUE=DATE-TIME:20030919T113000" | 723 | DTEND;VALUE=DATE-TIME:20030919T113000" |
| 756 | "&2003/9/19 09:00-11:30 non-recurring" | 724 | "&2003/9/19 09:00-11:30 non-recurring\n" |
| 757 | "&19/9/2003 09:00-11:30 non-recurring" | 725 | "&19/9/2003 09:00-11:30 non-recurring\n" |
| 758 | "&9/19/2003 09:00-11:30 non-recurring") | 726 | "&9/19/2003 09:00-11:30 non-recurring\n") |
| 759 | (icalendar-tests--test-import | 727 | (icalendar-tests--test-import |
| 760 | "SUMMARY:non-recurring allday | 728 | "SUMMARY:non-recurring allday |
| 761 | DTSTART;VALUE=DATE-TIME:20030919" | 729 | DTSTART;VALUE=DATE-TIME:20030919" |
| 762 | "&2003/9/19 non-recurring allday" | 730 | "&2003/9/19 non-recurring allday\n" |
| 763 | "&19/9/2003 non-recurring allday" | 731 | "&19/9/2003 non-recurring allday\n" |
| 764 | "&9/19/2003 non-recurring allday") | 732 | "&9/19/2003 non-recurring allday\n") |
| 765 | (icalendar-tests--test-import | 733 | (icalendar-tests--test-import |
| 766 | ;; do not remove the trailing blank after "long"! | 734 | ;; Checkdoc removes trailing blanks. Therefore: format! |
| 767 | "SUMMARY:long | 735 | (format "%s\n%s\n%s" "SUMMARY:long " " summary" |
| 768 | summary | 736 | "DTSTART;VALUE=DATE:20030919") |
| 769 | DTSTART;VALUE=DATE:20030919" | 737 | "&2003/9/19 long summary\n" |
| 770 | "&2003/9/19 long summary" | 738 | "&19/9/2003 long summary\n" |
| 771 | "&19/9/2003 long summary" | 739 | "&9/19/2003 long summary\n") |
| 772 | "&9/19/2003 long summary") | ||
| 773 | (icalendar-tests--test-import | 740 | (icalendar-tests--test-import |
| 774 | "UID:748f2da0-0d9b-11d8-97af-b4ec8686ea61 | 741 | "UID:748f2da0-0d9b-11d8-97af-b4ec8686ea61 |
| 775 | SUMMARY:Sommerferien | 742 | SUMMARY:Sommerferien |
| @@ -791,7 +758,8 @@ DTSTAMP:20031103T011641Z | |||
| 791 | " | 758 | " |
| 792 | "&%%(and (diary-block 7 19 2004 8 27 2004)) Sommerferien | 759 | "&%%(and (diary-block 7 19 2004 8 27 2004)) Sommerferien |
| 793 | Status: TENTATIVE | 760 | Status: TENTATIVE |
| 794 | Class: PRIVATE") | 761 | Class: PRIVATE |
| 762 | ") | ||
| 795 | (icalendar-tests--test-import | 763 | (icalendar-tests--test-import |
| 796 | "UID | 764 | "UID |
| 797 | :04979712-3902-11d9-93dd-8f9f4afe08da | 765 | :04979712-3902-11d9-93dd-8f9f4afe08da |
| @@ -814,13 +782,13 @@ LAST-MODIFIED | |||
| 814 | " | 782 | " |
| 815 | "&2004/11/23 14:00-14:30 folded summary | 783 | "&2004/11/23 14:00-14:30 folded summary |
| 816 | Status: TENTATIVE | 784 | Status: TENTATIVE |
| 817 | Class: PRIVATE" | 785 | Class: PRIVATE\n" |
| 818 | "&23/11/2004 14:00-14:30 folded summary | 786 | "&23/11/2004 14:00-14:30 folded summary |
| 819 | Status: TENTATIVE | 787 | Status: TENTATIVE |
| 820 | Class: PRIVATE" | 788 | Class: PRIVATE\n" |
| 821 | "&11/23/2004 14:00-14:30 folded summary | 789 | "&11/23/2004 14:00-14:30 folded summary |
| 822 | Status: TENTATIVE | 790 | Status: TENTATIVE |
| 823 | Class: PRIVATE") | 791 | Class: PRIVATE\n") |
| 824 | 792 | ||
| 825 | (icalendar-tests--test-import | 793 | (icalendar-tests--test-import |
| 826 | "UID | 794 | "UID |
| @@ -842,13 +810,13 @@ DTSTAMP | |||
| 842 | " | 810 | " |
| 843 | "&2004/11/23 14:45-15:45 another example | 811 | "&2004/11/23 14:45-15:45 another example |
| 844 | Status: TENTATIVE | 812 | Status: TENTATIVE |
| 845 | Class: PRIVATE" | 813 | Class: PRIVATE\n" |
| 846 | "&23/11/2004 14:45-15:45 another example | 814 | "&23/11/2004 14:45-15:45 another example |
| 847 | Status: TENTATIVE | 815 | Status: TENTATIVE |
| 848 | Class: PRIVATE" | 816 | Class: PRIVATE\n" |
| 849 | "&11/23/2004 14:45-15:45 another example | 817 | "&11/23/2004 14:45-15:45 another example |
| 850 | Status: TENTATIVE | 818 | Status: TENTATIVE |
| 851 | Class: PRIVATE")) | 819 | Class: PRIVATE\n")) |
| 852 | 820 | ||
| 853 | (ert-deftest icalendar-import-rrule () | 821 | (ert-deftest icalendar-import-rrule () |
| 854 | (icalendar-tests--test-import | 822 | (icalendar-tests--test-import |
| @@ -857,9 +825,9 @@ DTSTART;VALUE=DATE-TIME:20030919T090000 | |||
| 857 | DTEND;VALUE=DATE-TIME:20030919T113000 | 825 | DTEND;VALUE=DATE-TIME:20030919T113000 |
| 858 | RRULE:FREQ=DAILY; | 826 | RRULE:FREQ=DAILY; |
| 859 | " | 827 | " |
| 860 | "&%%(and (diary-cyclic 1 2003 9 19)) 09:00-11:30 rrule daily" | 828 | "&%%(and (diary-cyclic 1 2003 9 19)) 09:00-11:30 rrule daily\n" |
| 861 | "&%%(and (diary-cyclic 1 19 9 2003)) 09:00-11:30 rrule daily" | 829 | "&%%(and (diary-cyclic 1 19 9 2003)) 09:00-11:30 rrule daily\n" |
| 862 | "&%%(and (diary-cyclic 1 9 19 2003)) 09:00-11:30 rrule daily") | 830 | "&%%(and (diary-cyclic 1 9 19 2003)) 09:00-11:30 rrule daily\n") |
| 863 | ;; RRULE examples | 831 | ;; RRULE examples |
| 864 | (icalendar-tests--test-import | 832 | (icalendar-tests--test-import |
| 865 | "SUMMARY:rrule daily | 833 | "SUMMARY:rrule daily |
| @@ -867,9 +835,9 @@ DTSTART;VALUE=DATE-TIME:20030919T090000 | |||
| 867 | DTEND;VALUE=DATE-TIME:20030919T113000 | 835 | DTEND;VALUE=DATE-TIME:20030919T113000 |
| 868 | RRULE:FREQ=DAILY;INTERVAL=2 | 836 | RRULE:FREQ=DAILY;INTERVAL=2 |
| 869 | " | 837 | " |
| 870 | "&%%(and (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily" | 838 | "&%%(and (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily\n" |
| 871 | "&%%(and (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily" | 839 | "&%%(and (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily\n" |
| 872 | "&%%(and (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily") | 840 | "&%%(and (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily\n") |
| 873 | (icalendar-tests--test-import | 841 | (icalendar-tests--test-import |
| 874 | "SUMMARY:rrule daily with exceptions | 842 | "SUMMARY:rrule daily with exceptions |
| 875 | DTSTART;VALUE=DATE-TIME:20030919T090000 | 843 | DTSTART;VALUE=DATE-TIME:20030919T090000 |
| @@ -877,36 +845,36 @@ DTEND;VALUE=DATE-TIME:20030919T113000 | |||
| 877 | RRULE:FREQ=DAILY;INTERVAL=2 | 845 | RRULE:FREQ=DAILY;INTERVAL=2 |
| 878 | EXDATE:20030921,20030925 | 846 | EXDATE:20030921,20030925 |
| 879 | " | 847 | " |
| 880 | "&%%(and (not (diary-date 2003 9 25)) (not (diary-date 2003 9 21)) (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily with exceptions" | 848 | "&%%(and (not (diary-date 2003 9 25)) (not (diary-date 2003 9 21)) (diary-cyclic 2 2003 9 19)) 09:00-11:30 rrule daily with exceptions\n" |
| 881 | "&%%(and (not (diary-date 25 9 2003)) (not (diary-date 21 9 2003)) (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily with exceptions" | 849 | "&%%(and (not (diary-date 25 9 2003)) (not (diary-date 21 9 2003)) (diary-cyclic 2 19 9 2003)) 09:00-11:30 rrule daily with exceptions\n" |
| 882 | "&%%(and (not (diary-date 9 25 2003)) (not (diary-date 9 21 2003)) (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily with exceptions") | 850 | "&%%(and (not (diary-date 9 25 2003)) (not (diary-date 9 21 2003)) (diary-cyclic 2 9 19 2003)) 09:00-11:30 rrule daily with exceptions\n") |
| 883 | (icalendar-tests--test-import | 851 | (icalendar-tests--test-import |
| 884 | "SUMMARY:rrule weekly | 852 | "SUMMARY:rrule weekly |
| 885 | DTSTART;VALUE=DATE-TIME:20030919T090000 | 853 | DTSTART;VALUE=DATE-TIME:20030919T090000 |
| 886 | DTEND;VALUE=DATE-TIME:20030919T113000 | 854 | DTEND;VALUE=DATE-TIME:20030919T113000 |
| 887 | RRULE:FREQ=WEEKLY; | 855 | RRULE:FREQ=WEEKLY; |
| 888 | " | 856 | " |
| 889 | "&%%(and (diary-cyclic 7 2003 9 19)) 09:00-11:30 rrule weekly" | 857 | "&%%(and (diary-cyclic 7 2003 9 19)) 09:00-11:30 rrule weekly\n" |
| 890 | "&%%(and (diary-cyclic 7 19 9 2003)) 09:00-11:30 rrule weekly" | 858 | "&%%(and (diary-cyclic 7 19 9 2003)) 09:00-11:30 rrule weekly\n" |
| 891 | "&%%(and (diary-cyclic 7 9 19 2003)) 09:00-11:30 rrule weekly") | 859 | "&%%(and (diary-cyclic 7 9 19 2003)) 09:00-11:30 rrule weekly\n") |
| 892 | (icalendar-tests--test-import | 860 | (icalendar-tests--test-import |
| 893 | "SUMMARY:rrule monthly no end | 861 | "SUMMARY:rrule monthly no end |
| 894 | DTSTART;VALUE=DATE-TIME:20030919T090000 | 862 | DTSTART;VALUE=DATE-TIME:20030919T090000 |
| 895 | DTEND;VALUE=DATE-TIME:20030919T113000 | 863 | DTEND;VALUE=DATE-TIME:20030919T113000 |
| 896 | RRULE:FREQ=MONTHLY; | 864 | RRULE:FREQ=MONTHLY; |
| 897 | " | 865 | " |
| 898 | "&%%(and (diary-date t t 19) (diary-block 2003 9 19 9999 1 1)) 09:00-11:30 rrule monthly no end" | 866 | "&%%(and (diary-date t t 19) (diary-block 2003 9 19 9999 1 1)) 09:00-11:30 rrule monthly no end\n" |
| 899 | "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 1 1 9999)) 09:00-11:30 rrule monthly no end" | 867 | "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 1 1 9999)) 09:00-11:30 rrule monthly no end\n" |
| 900 | "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 1 9999)) 09:00-11:30 rrule monthly no end") | 868 | "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 1 9999)) 09:00-11:30 rrule monthly no end\n") |
| 901 | (icalendar-tests--test-import | 869 | (icalendar-tests--test-import |
| 902 | "SUMMARY:rrule monthly with end | 870 | "SUMMARY:rrule monthly with end |
| 903 | DTSTART;VALUE=DATE-TIME:20030919T090000 | 871 | DTSTART;VALUE=DATE-TIME:20030919T090000 |
| 904 | DTEND;VALUE=DATE-TIME:20030919T113000 | 872 | DTEND;VALUE=DATE-TIME:20030919T113000 |
| 905 | RRULE:FREQ=MONTHLY;UNTIL=20050819; | 873 | RRULE:FREQ=MONTHLY;UNTIL=20050819; |
| 906 | " | 874 | " |
| 907 | "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2005 8 19)) 09:00-11:30 rrule monthly with end" | 875 | "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2005 8 19)) 09:00-11:30 rrule monthly with end\n" |
| 908 | "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 8 2005)) 09:00-11:30 rrule monthly with end" | 876 | "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 8 2005)) 09:00-11:30 rrule monthly with end\n" |
| 909 | "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 8 19 2005)) 09:00-11:30 rrule monthly with end") | 877 | "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 8 19 2005)) 09:00-11:30 rrule monthly with end\n") |
| 910 | (icalendar-tests--test-import | 878 | (icalendar-tests--test-import |
| 911 | "DTSTART;VALUE=DATE:20040815 | 879 | "DTSTART;VALUE=DATE:20040815 |
| 912 | DTEND;VALUE=DATE:20040816 | 880 | DTEND;VALUE=DATE:20040816 |
| @@ -914,81 +882,81 @@ SUMMARY:Maria Himmelfahrt | |||
| 914 | UID:CC56BEA6-49D2-11D8-8833-00039386D1C2-RID | 882 | UID:CC56BEA6-49D2-11D8-8833-00039386D1C2-RID |
| 915 | RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=8 | 883 | RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=8 |
| 916 | " | 884 | " |
| 917 | "&%%(and (diary-anniversary 2004 8 15)) Maria Himmelfahrt" | 885 | "&%%(and (diary-anniversary 2004 8 15)) Maria Himmelfahrt\n" |
| 918 | "&%%(and (diary-anniversary 15 8 2004)) Maria Himmelfahrt" | 886 | "&%%(and (diary-anniversary 15 8 2004)) Maria Himmelfahrt\n" |
| 919 | "&%%(and (diary-anniversary 8 15 2004)) Maria Himmelfahrt") | 887 | "&%%(and (diary-anniversary 8 15 2004)) Maria Himmelfahrt\n") |
| 920 | (icalendar-tests--test-import | 888 | (icalendar-tests--test-import |
| 921 | "SUMMARY:rrule yearly | 889 | "SUMMARY:rrule yearly |
| 922 | DTSTART;VALUE=DATE-TIME:20030919T090000 | 890 | DTSTART;VALUE=DATE-TIME:20030919T090000 |
| 923 | DTEND;VALUE=DATE-TIME:20030919T113000 | 891 | DTEND;VALUE=DATE-TIME:20030919T113000 |
| 924 | RRULE:FREQ=YEARLY;INTERVAL=2 | 892 | RRULE:FREQ=YEARLY;INTERVAL=2 |
| 925 | " | 893 | " |
| 926 | "&%%(and (diary-anniversary 2003 9 19)) 09:00-11:30 rrule yearly" ;FIXME | 894 | "&%%(and (diary-anniversary 2003 9 19)) 09:00-11:30 rrule yearly\n" ;FIXME |
| 927 | "&%%(and (diary-anniversary 19 9 2003)) 09:00-11:30 rrule yearly" ;FIXME | 895 | "&%%(and (diary-anniversary 19 9 2003)) 09:00-11:30 rrule yearly\n" ;FIXME |
| 928 | "&%%(and (diary-anniversary 9 19 2003)) 09:00-11:30 rrule yearly") ;FIXME | 896 | "&%%(and (diary-anniversary 9 19 2003)) 09:00-11:30 rrule yearly\n") ;FIXME |
| 929 | (icalendar-tests--test-import | 897 | (icalendar-tests--test-import |
| 930 | "SUMMARY:rrule count daily short | 898 | "SUMMARY:rrule count daily short |
| 931 | DTSTART;VALUE=DATE-TIME:20030919T090000 | 899 | DTSTART;VALUE=DATE-TIME:20030919T090000 |
| 932 | DTEND;VALUE=DATE-TIME:20030919T113000 | 900 | DTEND;VALUE=DATE-TIME:20030919T113000 |
| 933 | RRULE:FREQ=DAILY;COUNT=1;INTERVAL=1 | 901 | RRULE:FREQ=DAILY;COUNT=1;INTERVAL=1 |
| 934 | " | 902 | " |
| 935 | "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 9 19)) 09:00-11:30 rrule count daily short" | 903 | "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 9 19)) 09:00-11:30 rrule count daily short\n" |
| 936 | "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 19 9 2003)) 09:00-11:30 rrule count daily short" | 904 | "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 19 9 2003)) 09:00-11:30 rrule count daily short\n" |
| 937 | "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 9 19 2003)) 09:00-11:30 rrule count daily short") | 905 | "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 9 19 2003)) 09:00-11:30 rrule count daily short\n") |
| 938 | (icalendar-tests--test-import | 906 | (icalendar-tests--test-import |
| 939 | "SUMMARY:rrule count daily long | 907 | "SUMMARY:rrule count daily long |
| 940 | DTSTART;VALUE=DATE-TIME:20030919T090000 | 908 | DTSTART;VALUE=DATE-TIME:20030919T090000 |
| 941 | DTEND;VALUE=DATE-TIME:20030919T113000 | 909 | DTEND;VALUE=DATE-TIME:20030919T113000 |
| 942 | RRULE:FREQ=DAILY;COUNT=14;INTERVAL=1 | 910 | RRULE:FREQ=DAILY;COUNT=14;INTERVAL=1 |
| 943 | " | 911 | " |
| 944 | "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 10 2)) 09:00-11:30 rrule count daily long" | 912 | "&%%(and (diary-cyclic 1 2003 9 19) (diary-block 2003 9 19 2003 10 2)) 09:00-11:30 rrule count daily long\n" |
| 945 | "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 2 10 2003)) 09:00-11:30 rrule count daily long" | 913 | "&%%(and (diary-cyclic 1 19 9 2003) (diary-block 19 9 2003 2 10 2003)) 09:00-11:30 rrule count daily long\n" |
| 946 | "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 10 2 2003)) 09:00-11:30 rrule count daily long") | 914 | "&%%(and (diary-cyclic 1 9 19 2003) (diary-block 9 19 2003 10 2 2003)) 09:00-11:30 rrule count daily long\n") |
| 947 | (icalendar-tests--test-import | 915 | (icalendar-tests--test-import |
| 948 | "SUMMARY:rrule count bi-weekly 3 times | 916 | "SUMMARY:rrule count bi-weekly 3 times |
| 949 | DTSTART;VALUE=DATE-TIME:20030919T090000 | 917 | DTSTART;VALUE=DATE-TIME:20030919T090000 |
| 950 | DTEND;VALUE=DATE-TIME:20030919T113000 | 918 | DTEND;VALUE=DATE-TIME:20030919T113000 |
| 951 | RRULE:FREQ=WEEKLY;COUNT=3;INTERVAL=2 | 919 | RRULE:FREQ=WEEKLY;COUNT=3;INTERVAL=2 |
| 952 | " | 920 | " |
| 953 | "&%%(and (diary-cyclic 14 2003 9 19) (diary-block 2003 9 19 2003 10 31)) 09:00-11:30 rrule count bi-weekly 3 times" | 921 | "&%%(and (diary-cyclic 14 2003 9 19) (diary-block 2003 9 19 2003 10 31)) 09:00-11:30 rrule count bi-weekly 3 times\n" |
| 954 | "&%%(and (diary-cyclic 14 19 9 2003) (diary-block 19 9 2003 31 10 2003)) 09:00-11:30 rrule count bi-weekly 3 times" | 922 | "&%%(and (diary-cyclic 14 19 9 2003) (diary-block 19 9 2003 31 10 2003)) 09:00-11:30 rrule count bi-weekly 3 times\n" |
| 955 | "&%%(and (diary-cyclic 14 9 19 2003) (diary-block 9 19 2003 10 31 2003)) 09:00-11:30 rrule count bi-weekly 3 times") | 923 | "&%%(and (diary-cyclic 14 9 19 2003) (diary-block 9 19 2003 10 31 2003)) 09:00-11:30 rrule count bi-weekly 3 times\n") |
| 956 | (icalendar-tests--test-import | 924 | (icalendar-tests--test-import |
| 957 | "SUMMARY:rrule count monthly | 925 | "SUMMARY:rrule count monthly |
| 958 | DTSTART;VALUE=DATE-TIME:20030919T090000 | 926 | DTSTART;VALUE=DATE-TIME:20030919T090000 |
| 959 | DTEND;VALUE=DATE-TIME:20030919T113000 | 927 | DTEND;VALUE=DATE-TIME:20030919T113000 |
| 960 | RRULE:FREQ=MONTHLY;INTERVAL=1;COUNT=5 | 928 | RRULE:FREQ=MONTHLY;INTERVAL=1;COUNT=5 |
| 961 | " | 929 | " |
| 962 | "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 1 19)) 09:00-11:30 rrule count monthly" | 930 | "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 1 19)) 09:00-11:30 rrule count monthly\n" |
| 963 | "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 1 2004)) 09:00-11:30 rrule count monthly" | 931 | "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 1 2004)) 09:00-11:30 rrule count monthly\n" |
| 964 | "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 19 2004)) 09:00-11:30 rrule count monthly") | 932 | "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 1 19 2004)) 09:00-11:30 rrule count monthly\n") |
| 965 | (icalendar-tests--test-import | 933 | (icalendar-tests--test-import |
| 966 | "SUMMARY:rrule count every second month | 934 | "SUMMARY:rrule count every second month |
| 967 | DTSTART;VALUE=DATE-TIME:20030919T090000 | 935 | DTSTART;VALUE=DATE-TIME:20030919T090000 |
| 968 | DTEND;VALUE=DATE-TIME:20030919T113000 | 936 | DTEND;VALUE=DATE-TIME:20030919T113000 |
| 969 | RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=5 | 937 | RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=5 |
| 970 | " | 938 | " |
| 971 | "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 5 19)) 09:00-11:30 rrule count every second month" ;FIXME | 939 | "&%%(and (diary-date t t 19) (diary-block 2003 9 19 2004 5 19)) 09:00-11:30 rrule count every second month\n" ;FIXME |
| 972 | "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 5 2004)) 09:00-11:30 rrule count every second month" ;FIXME | 940 | "&%%(and (diary-date 19 t t) (diary-block 19 9 2003 19 5 2004)) 09:00-11:30 rrule count every second month\n" ;FIXME |
| 973 | "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 5 19 2004)) 09:00-11:30 rrule count every second month") ;FIXME | 941 | "&%%(and (diary-date t 19 t) (diary-block 9 19 2003 5 19 2004)) 09:00-11:30 rrule count every second month\n") ;FIXME |
| 974 | (icalendar-tests--test-import | 942 | (icalendar-tests--test-import |
| 975 | "SUMMARY:rrule count yearly | 943 | "SUMMARY:rrule count yearly |
| 976 | DTSTART;VALUE=DATE-TIME:20030919T090000 | 944 | DTSTART;VALUE=DATE-TIME:20030919T090000 |
| 977 | DTEND;VALUE=DATE-TIME:20030919T113000 | 945 | DTEND;VALUE=DATE-TIME:20030919T113000 |
| 978 | RRULE:FREQ=YEARLY;INTERVAL=1;COUNT=5 | 946 | RRULE:FREQ=YEARLY;INTERVAL=1;COUNT=5 |
| 979 | " | 947 | " |
| 980 | "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2007 9 19)) 09:00-11:30 rrule count yearly" | 948 | "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2007 9 19)) 09:00-11:30 rrule count yearly\n" |
| 981 | "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2007)) 09:00-11:30 rrule count yearly" | 949 | "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2007)) 09:00-11:30 rrule count yearly\n" |
| 982 | "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2007)) 09:00-11:30 rrule count yearly") | 950 | "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2007)) 09:00-11:30 rrule count yearly\n") |
| 983 | (icalendar-tests--test-import | 951 | (icalendar-tests--test-import |
| 984 | "SUMMARY:rrule count every second year | 952 | "SUMMARY:rrule count every second year |
| 985 | DTSTART;VALUE=DATE-TIME:20030919T090000 | 953 | DTSTART;VALUE=DATE-TIME:20030919T090000 |
| 986 | DTEND;VALUE=DATE-TIME:20030919T113000 | 954 | DTEND;VALUE=DATE-TIME:20030919T113000 |
| 987 | RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=5 | 955 | RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=5 |
| 988 | " | 956 | " |
| 989 | "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2011 9 19)) 09:00-11:30 rrule count every second year" ;FIXME!!! | 957 | "&%%(and (diary-date t 9 19) (diary-block 2003 9 19 2011 9 19)) 09:00-11:30 rrule count every second year\n" ;FIXME!!! |
| 990 | "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2011)) 09:00-11:30 rrule count every second year" ;FIXME!!! | 958 | "&%%(and (diary-date 19 9 t) (diary-block 19 9 2003 19 9 2011)) 09:00-11:30 rrule count every second year\n" ;FIXME!!! |
| 991 | "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2011)) 09:00-11:30 rrule count every second year") ;FIXME!!! | 959 | "&%%(and (diary-date 9 19 t) (diary-block 9 19 2003 9 19 2011)) 09:00-11:30 rrule count every second year\n") ;FIXME!!! |
| 992 | ) | 960 | ) |
| 993 | 961 | ||
| 994 | (ert-deftest icalendar-import-duration () | 962 | (ert-deftest icalendar-import-duration () |
| @@ -998,9 +966,9 @@ RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=5 | |||
| 998 | SUMMARY:duration | 966 | SUMMARY:duration |
| 999 | DURATION:P7D | 967 | DURATION:P7D |
| 1000 | " | 968 | " |
| 1001 | "&%%(and (diary-block 2005 2 17 2005 2 23)) duration" | 969 | "&%%(and (diary-block 2005 2 17 2005 2 23)) duration\n" |
| 1002 | "&%%(and (diary-block 17 2 2005 23 2 2005)) duration" | 970 | "&%%(and (diary-block 17 2 2005 23 2 2005)) duration\n" |
| 1003 | "&%%(and (diary-block 2 17 2005 2 23 2005)) duration") | 971 | "&%%(and (diary-block 2 17 2005 2 23 2005)) duration\n") |
| 1004 | (icalendar-tests--test-import | 972 | (icalendar-tests--test-import |
| 1005 | "UID:20041127T183329Z-18215-1001-4536-49109@andromeda | 973 | "UID:20041127T183329Z-18215-1001-4536-49109@andromeda |
| 1006 | DTSTAMP:20041127T183315Z | 974 | DTSTAMP:20041127T183315Z |
| @@ -1014,11 +982,11 @@ SEQUENCE:1 | |||
| 1014 | CREATED:20041127T183329 | 982 | CREATED:20041127T183329 |
| 1015 | " | 983 | " |
| 1016 | "&%%(and (diary-cyclic 1 2001 12 21) (diary-block 2001 12 21 2001 12 29)) Urlaub | 984 | "&%%(and (diary-cyclic 1 2001 12 21) (diary-block 2001 12 21 2001 12 29)) Urlaub |
| 1017 | Class: PUBLIC" | 985 | Class: PUBLIC\n" |
| 1018 | "&%%(and (diary-cyclic 1 21 12 2001) (diary-block 21 12 2001 29 12 2001)) Urlaub | 986 | "&%%(and (diary-cyclic 1 21 12 2001) (diary-block 21 12 2001 29 12 2001)) Urlaub |
| 1019 | Class: PUBLIC" | 987 | Class: PUBLIC\n" |
| 1020 | "&%%(and (diary-cyclic 1 12 21 2001) (diary-block 12 21 2001 12 29 2001)) Urlaub | 988 | "&%%(and (diary-cyclic 1 12 21 2001) (diary-block 12 21 2001 12 29 2001)) Urlaub |
| 1021 | Class: PUBLIC")) | 989 | Class: PUBLIC\n")) |
| 1022 | 990 | ||
| 1023 | (ert-deftest icalendar-import-bug-6766 () | 991 | (ert-deftest icalendar-import-bug-6766 () |
| 1024 | ;;bug#6766 -- multiple byday values in a weekly rrule | 992 | ;;bug#6766 -- multiple byday values in a weekly rrule |
| @@ -1049,20 +1017,62 @@ UID:8814e3f9-7482-408f-996c-3bfe486a1263 | |||
| 1049 | Status: CONFIRMED | 1017 | Status: CONFIRMED |
| 1050 | Class: PUBLIC | 1018 | Class: PUBLIC |
| 1051 | &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 2010 4 22)) Tues + Thurs thinking | 1019 | &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 2010 4 22)) Tues + Thurs thinking |
| 1052 | Class: PUBLIC" | 1020 | Class: PUBLIC |
| 1053 | 1021 | " | |
| 1054 | "&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 21 4 2010)) 11:30-12:00 Scrum | 1022 | "&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 21 4 2010)) 11:30-12:00 Scrum |
| 1055 | Status: CONFIRMED | 1023 | Status: CONFIRMED |
| 1056 | Class: PUBLIC | 1024 | Class: PUBLIC |
| 1057 | &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 22 4 2010)) Tues + Thurs thinking | 1025 | &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 22 4 2010)) Tues + Thurs thinking |
| 1058 | Class: PUBLIC" | 1026 | Class: PUBLIC |
| 1059 | 1027 | " | |
| 1060 | "&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 4 21 2010)) 11:30-12:00 Scrum | 1028 | "&%%(and (memq (calendar-day-of-week date) '(1 3 4 5)) (diary-cyclic 1 4 21 2010)) 11:30-12:00 Scrum |
| 1061 | Status: CONFIRMED | 1029 | Status: CONFIRMED |
| 1062 | Class: PUBLIC | 1030 | Class: PUBLIC |
| 1063 | &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 4 22 2010)) Tues + Thurs thinking | 1031 | &%%(and (memq (calendar-day-of-week date) '(2 4)) (diary-cyclic 1 4 22 2010)) Tues + Thurs thinking |
| 1064 | Class: PUBLIC")) | 1032 | Class: PUBLIC |
| 1033 | ")) | ||
| 1065 | 1034 | ||
| 1035 | (ert-deftest icalendar-import-multiple-vcalendars () | ||
| 1036 | (icalendar-tests--test-import | ||
| 1037 | "DTSTART;VALUE=DATE:20110723 | ||
| 1038 | SUMMARY:event-1 | ||
| 1039 | " | ||
| 1040 | "&2011/7/23 event-1\n" | ||
| 1041 | "&23/7/2011 event-1\n" | ||
| 1042 | "&7/23/2011 event-1\n") | ||
| 1043 | |||
| 1044 | (icalendar-tests--test-import | ||
| 1045 | "BEGIN:VCALENDAR | ||
| 1046 | PRODID:-//Emacs//NONSGML icalendar.el//EN | ||
| 1047 | VERSION:2.0\nBEGIN:VEVENT | ||
| 1048 | DTSTART;VALUE=DATE:20110723 | ||
| 1049 | SUMMARY:event-1 | ||
| 1050 | END:VEVENT | ||
| 1051 | END:VCALENDAR | ||
| 1052 | BEGIN:VCALENDAR | ||
| 1053 | PRODID:-//Emacs//NONSGML icalendar.el//EN | ||
| 1054 | VERSION:2.0 | ||
| 1055 | BEGIN:VEVENT | ||
| 1056 | DTSTART;VALUE=DATE:20110724 | ||
| 1057 | SUMMARY:event-2 | ||
| 1058 | END:VEVENT | ||
| 1059 | END:VCALENDAR | ||
| 1060 | BEGIN:VCALENDAR | ||
| 1061 | PRODID:-//Emacs//NONSGML icalendar.el//EN | ||
| 1062 | VERSION:2.0 | ||
| 1063 | BEGIN:VEVENT | ||
| 1064 | DTSTART;VALUE=DATE:20110725 | ||
| 1065 | SUMMARY:event-3a | ||
| 1066 | END:VEVENT | ||
| 1067 | BEGIN:VEVENT | ||
| 1068 | DTSTART;VALUE=DATE:20110725 | ||
| 1069 | SUMMARY:event-3b | ||
| 1070 | END:VEVENT | ||
| 1071 | END:VCALENDAR | ||
| 1072 | " | ||
| 1073 | "&2011/7/23 event-1\n&2011/7/24 event-2\n&2011/7/25 event-3a\n&2011/7/25 event-3b\n" | ||
| 1074 | "&23/7/2011 event-1\n&24/7/2011 event-2\n&25/7/2011 event-3a\n&25/7/2011 event-3b\n" | ||
| 1075 | "&7/23/2011 event-1\n&7/24/2011 event-2\n&7/25/2011 event-3a\n&7/25/2011 event-3b\n")) | ||
| 1066 | 1076 | ||
| 1067 | ;; ====================================================================== | 1077 | ;; ====================================================================== |
| 1068 | ;; Cycle | 1078 | ;; Cycle |
| @@ -1100,7 +1110,7 @@ Argument INPUT icalendar event string." | |||
| 1100 | (progn | 1110 | (progn |
| 1101 | ;; step 1: import | 1111 | ;; step 1: import |
| 1102 | (icalendar-import-buffer temp-diary t t) | 1112 | (icalendar-import-buffer temp-diary t t) |
| 1103 | 1113 | ||
| 1104 | ;; step 2: export what was just imported | 1114 | ;; step 2: export what was just imported |
| 1105 | (save-excursion | 1115 | (save-excursion |
| 1106 | (find-file temp-diary) | 1116 | (find-file temp-diary) |
| @@ -1113,7 +1123,7 @@ Argument INPUT icalendar event string." | |||
| 1113 | (when (re-search-forward "\nUID:.*\n" nil t) | 1123 | (when (re-search-forward "\nUID:.*\n" nil t) |
| 1114 | (replace-match "\n")) | 1124 | (replace-match "\n")) |
| 1115 | (let ((cycled (buffer-substring-no-properties (point-min) (point-max)))) | 1125 | (let ((cycled (buffer-substring-no-properties (point-min) (point-max)))) |
| 1116 | (should (icalendar-tests--compare-strings cycled org-input))))) | 1126 | (should (string= org-input cycled))))) |
| 1117 | ;; clean up | 1127 | ;; clean up |
| 1118 | (kill-buffer (find-buffer-visiting temp-diary)) | 1128 | (kill-buffer (find-buffer-visiting temp-diary)) |
| 1119 | (save-excursion | 1129 | (save-excursion |
| @@ -1211,12 +1221,14 @@ END:VCALENDAR" | |||
| 1211 | Desc: 10:30am - Blah | 1221 | Desc: 10:30am - Blah |
| 1212 | Location: Cccc | 1222 | Location: Cccc |
| 1213 | Organizer: MAILTO:aaaaaaa@aaaaaaa.com | 1223 | Organizer: MAILTO:aaaaaaa@aaaaaaa.com |
| 1214 | Status: CONFIRMED" | 1224 | Status: CONFIRMED |
| 1225 | " | ||
| 1215 | "&5/9/2003 10:30-15:30 On-Site Interview | 1226 | "&5/9/2003 10:30-15:30 On-Site Interview |
| 1216 | Desc: 10:30am - Blah | 1227 | Desc: 10:30am - Blah |
| 1217 | Location: Cccc | 1228 | Location: Cccc |
| 1218 | Organizer: MAILTO:aaaaaaa@aaaaaaa.com | 1229 | Organizer: MAILTO:aaaaaaa@aaaaaaa.com |
| 1219 | Status: CONFIRMED") | 1230 | Status: CONFIRMED |
| 1231 | ") | ||
| 1220 | 1232 | ||
| 1221 | ;; 2003-06-18 a | 1233 | ;; 2003-06-18 a |
| 1222 | (icalendar-tests--test-import | 1234 | (icalendar-tests--test-import |
| @@ -1255,12 +1267,14 @@ END:VALARM" | |||
| 1255 | Desc: 753 Zeichen hier radiert | 1267 | Desc: 753 Zeichen hier radiert |
| 1256 | Location: 555 or TN 555-5555 ID 5555 & NochWas (see below) | 1268 | Location: 555 or TN 555-5555 ID 5555 & NochWas (see below) |
| 1257 | Organizer: MAILTO:xxx@xxxxx.com | 1269 | Organizer: MAILTO:xxx@xxxxx.com |
| 1258 | Status: CONFIRMED" | 1270 | Status: CONFIRMED |
| 1271 | " | ||
| 1259 | "&6/23/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX | 1272 | "&6/23/2003 11:00-12:00 Dress Rehearsal for XXXX-XXXX |
| 1260 | Desc: 753 Zeichen hier radiert | 1273 | Desc: 753 Zeichen hier radiert |
| 1261 | Location: 555 or TN 555-5555 ID 5555 & NochWas (see below) | 1274 | Location: 555 or TN 555-5555 ID 5555 & NochWas (see below) |
| 1262 | Organizer: MAILTO:xxx@xxxxx.com | 1275 | Organizer: MAILTO:xxx@xxxxx.com |
| 1263 | Status: CONFIRMED") | 1276 | Status: CONFIRMED |
| 1277 | ") | ||
| 1264 | ;; 2003-06-18 b -- uses timezone | 1278 | ;; 2003-06-18 b -- uses timezone |
| 1265 | (icalendar-tests--test-import | 1279 | (icalendar-tests--test-import |
| 1266 | "BEGIN:VCALENDAR | 1280 | "BEGIN:VCALENDAR |
| @@ -1323,12 +1337,14 @@ END:VCALENDAR" | |||
| 1323 | Desc: Viele Zeichen standen hier früher | 1337 | Desc: Viele Zeichen standen hier früher |
| 1324 | Location: 123 or TN 123-1234 ID abcd & SonstWo (see below) | 1338 | Location: 123 or TN 123-1234 ID abcd & SonstWo (see below) |
| 1325 | Organizer: MAILTO:bbb@bbbbb.com | 1339 | Organizer: MAILTO:bbb@bbbbb.com |
| 1326 | Status: CONFIRMED" | 1340 | Status: CONFIRMED |
| 1341 | " | ||
| 1327 | "&6/23/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15 | 1342 | "&6/23/2003 17:00-18:00 Updated: Dress Rehearsal for ABC01-15 |
| 1328 | Desc: Viele Zeichen standen hier früher | 1343 | Desc: Viele Zeichen standen hier früher |
| 1329 | Location: 123 or TN 123-1234 ID abcd & SonstWo (see below) | 1344 | Location: 123 or TN 123-1234 ID abcd & SonstWo (see below) |
| 1330 | Organizer: MAILTO:bbb@bbbbb.com | 1345 | Organizer: MAILTO:bbb@bbbbb.com |
| 1331 | Status: CONFIRMED") | 1346 | Status: CONFIRMED |
| 1347 | ") | ||
| 1332 | ;; export 2004-10-28 block entries | 1348 | ;; export 2004-10-28 block entries |
| 1333 | (icalendar-tests--test-export | 1349 | (icalendar-tests--test-export |
| 1334 | nil | 1350 | nil |
| @@ -1382,7 +1398,7 @@ SUMMARY:may 30 - June 1: ee") | |||
| 1382 | "DTSTART;VALUE=DATE:20050606 | 1398 | "DTSTART;VALUE=DATE:20050606 |
| 1383 | DTEND;VALUE=DATE:20050609 | 1399 | DTEND;VALUE=DATE:20050609 |
| 1384 | SUMMARY:ff") | 1400 | SUMMARY:ff") |
| 1385 | 1401 | ||
| 1386 | ;; export 2004-10-28 anniversary entries | 1402 | ;; export 2004-10-28 anniversary entries |
| 1387 | (icalendar-tests--test-export | 1403 | (icalendar-tests--test-export |
| 1388 | nil | 1404 | nil |
| @@ -1697,7 +1713,8 @@ END:VCALENDAR | |||
| 1697 | Class: PRIVATE | 1713 | Class: PRIVATE |
| 1698 | &%%(and (diary-cyclic 7 1 11 2004)) Wwww aa hhhh | 1714 | &%%(and (diary-cyclic 7 1 11 2004)) Wwww aa hhhh |
| 1699 | Status: TENTATIVE | 1715 | Status: TENTATIVE |
| 1700 | Class: PRIVATE" | 1716 | Class: PRIVATE |
| 1717 | " | ||
| 1701 | "&11/23/2004 14:00-14:30 Jjjjj & Wwwww | 1718 | "&11/23/2004 14:00-14:30 Jjjjj & Wwwww |
| 1702 | Status: TENTATIVE | 1719 | Status: TENTATIVE |
| 1703 | Class: PRIVATE | 1720 | Class: PRIVATE |
| @@ -1716,7 +1733,8 @@ END:VCALENDAR | |||
| 1716 | Class: PRIVATE | 1733 | Class: PRIVATE |
| 1717 | &%%(and (diary-cyclic 7 11 1 2004)) Wwww aa hhhh | 1734 | &%%(and (diary-cyclic 7 11 1 2004)) Wwww aa hhhh |
| 1718 | Status: TENTATIVE | 1735 | Status: TENTATIVE |
| 1719 | Class: PRIVATE") | 1736 | Class: PRIVATE |
| 1737 | ") | ||
| 1720 | 1738 | ||
| 1721 | ;; 2004-09-09 pg | 1739 | ;; 2004-09-09 pg |
| 1722 | (icalendar-tests--test-export | 1740 | (icalendar-tests--test-export |
| @@ -1771,11 +1789,13 @@ DTSTAMP | |||
| 1771 | "&%%(and (diary-block 6 2 2005 6 2 2005)) Waitangi Day | 1789 | "&%%(and (diary-block 6 2 2005 6 2 2005)) Waitangi Day |
| 1772 | Desc: abcdef | 1790 | Desc: abcdef |
| 1773 | Status: CONFIRMED | 1791 | Status: CONFIRMED |
| 1774 | Class: PRIVATE" | 1792 | Class: PRIVATE |
| 1793 | " | ||
| 1775 | "&%%(and (diary-block 2 6 2005 2 6 2005)) Waitangi Day | 1794 | "&%%(and (diary-block 2 6 2005 2 6 2005)) Waitangi Day |
| 1776 | Desc: abcdef | 1795 | Desc: abcdef |
| 1777 | Status: CONFIRMED | 1796 | Status: CONFIRMED |
| 1778 | Class: PRIVATE") | 1797 | Class: PRIVATE |
| 1798 | ") | ||
| 1779 | 1799 | ||
| 1780 | ;; 2005-03-01 lt | 1800 | ;; 2005-03-01 lt |
| 1781 | (icalendar-tests--test-import | 1801 | (icalendar-tests--test-import |
| @@ -1785,8 +1805,8 @@ UID:6AFA7558-6994-11D9-8A3A-000A95A0E830-RID | |||
| 1785 | DTSTAMP:20050118T210335Z | 1805 | DTSTAMP:20050118T210335Z |
| 1786 | DURATION:P7D" | 1806 | DURATION:P7D" |
| 1787 | nil | 1807 | nil |
| 1788 | "&%%(and (diary-block 17 2 2005 23 2 2005)) Hhhhhh Aaaaa ii Aaaaaaaa" | 1808 | "&%%(and (diary-block 17 2 2005 23 2 2005)) Hhhhhh Aaaaa ii Aaaaaaaa\n" |
| 1789 | "&%%(and (diary-block 2 17 2005 2 23 2005)) Hhhhhh Aaaaa ii Aaaaaaaa") | 1809 | "&%%(and (diary-block 2 17 2005 2 23 2005)) Hhhhhh Aaaaa ii Aaaaaaaa\n") |
| 1790 | 1810 | ||
| 1791 | ;; 2005-03-23 lt | 1811 | ;; 2005-03-23 lt |
| 1792 | (icalendar-tests--test-export | 1812 | (icalendar-tests--test-export |
diff --git a/test/automated/lexbind-tests.el b/test/automated/lexbind-tests.el index 95b8bbe8858..22668bc7d02 100644 --- a/test/automated/lexbind-tests.el +++ b/test/automated/lexbind-tests.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; lexbind-tests.el --- Testing the lexbind byte-compiler | 1 | ;;; lexbind-tests.el --- Testing the lexbind byte-compiler |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2011-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Stefan Monnier <monnier@iro.umontreal.ca> | 5 | ;; Author: Stefan Monnier <monnier@iro.umontreal.ca> |
| 6 | ;; Keywords: | 6 | ;; Keywords: |
diff --git a/test/newsticker-testsuite.el b/test/automated/newsticker-tests.el index 99e40a7ef15..5b60535e463 100644 --- a/test/newsticker-testsuite.el +++ b/test/automated/newsticker-tests.el | |||
| @@ -1,14 +1,9 @@ | |||
| 1 | ;;; newsticker-testsuite.el --- Test suite for newsticker. | 1 | ;;; newsticker-testsuite.el --- Test suite for newsticker. |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2003-2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2003-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Ulf Jasper <ulf.jasper@web.de> | 5 | ;; Author: Ulf Jasper <ulf.jasper@web.de> |
| 6 | ;; Filename: newsticker-testsuite.el | ||
| 7 | ;; URL: http://www.nongnu.org/newsticker | ||
| 8 | ;; Keywords: News, RSS, Atom | 6 | ;; Keywords: News, RSS, Atom |
| 9 | ;; Time-stamp: "14. Juni 2008, 12:09:39 (ulf)" | ||
| 10 | |||
| 11 | ;; ====================================================================== | ||
| 12 | 7 | ||
| 13 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| 14 | 9 | ||
| @@ -25,42 +20,26 @@ | |||
| 25 | ;; You should have received a copy of the GNU General Public License | 20 | ;; You should have received a copy of the GNU General Public License |
| 26 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | 21 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
| 27 | 22 | ||
| 28 | ;; ====================================================================== | ||
| 29 | |||
| 30 | ;;; Commentary: | 23 | ;;; Commentary: |
| 31 | 24 | ||
| 32 | ;;; Code: | 25 | ;;; Code: |
| 33 | 26 | ||
| 34 | (require 'cl) ; assert | 27 | (require 'ert) |
| 35 | 28 | (require 'newsticker) | |
| 36 | ;; ====================================================================== | ||
| 37 | ;; Entry point | ||
| 38 | ;; ====================================================================== | ||
| 39 | (defun newsticker--testsuite () | ||
| 40 | "Unit test for newsticker. | ||
| 41 | Subtests signal errors if something goes wrong." | ||
| 42 | (interactive) | ||
| 43 | (newsticker--test--guid) | ||
| 44 | (newsticker--test--cache-contains) | ||
| 45 | (newsticker--test--decode-iso8601-date) | ||
| 46 | (newsticker--test--decode-rfc822-date) | ||
| 47 | (newsticker--test--group-manage-orphan-feeds) | ||
| 48 | (message "All tests passed successfully.")) | ||
| 49 | 29 | ||
| 50 | ;; ====================================================================== | 30 | ;; ====================================================================== |
| 51 | ;; Tests for newsticker-backend | 31 | ;; Tests for newsticker-backend |
| 52 | ;; ====================================================================== | 32 | ;; ====================================================================== |
| 53 | (defun newsticker--test--guid () | 33 | (ert-deftest newsticker--guid () |
| 54 | "Test `newsticker-guid-*'. | 34 | "Test for `newsticker--guid-*'. |
| 55 | Signals an error if something goes wrong." | 35 | Signals an error if something goes wrong." |
| 56 | (assert (string= "blah" (newsticker--guid-to-string "blah"))) | 36 | (should (string= "blah" (newsticker--guid-to-string "blah"))) |
| 57 | (assert (string= "myguid" (newsticker--guid '("title1" "description1" "link1" | 37 | (should (string= "myguid" (newsticker--guid '("title1" "description1" "link1" |
| 58 | nil 'new 42 nil nil | 38 | nil 'new 42 nil nil |
| 59 | ((guid () "myguid"))))))) | 39 | ((guid () "myguid"))))))) |
| 60 | 40 | ||
| 61 | (defun newsticker--test--cache-contains () | 41 | (ert-deftest newsticker--cache-contains () |
| 62 | "Test `newsticker--test--cache-contains'. | 42 | "Test for `newsticker--cache-contains'." |
| 63 | Signals an error if something goes wrong." | ||
| 64 | (let ((newsticker--cache '((feed1 | 43 | (let ((newsticker--cache '((feed1 |
| 65 | ("title1" "description1" "link1" nil 'new 42 | 44 | ("title1" "description1" "link1" nil 'new 42 |
| 66 | nil nil ((guid () "myguid"))))))) | 45 | nil nil ((guid () "myguid"))))))) |
| @@ -68,78 +47,68 @@ Signals an error if something goes wrong." | |||
| 68 | (assoc 'guid (newsticker--extra '("title1" "description1" | 47 | (assoc 'guid (newsticker--extra '("title1" "description1" |
| 69 | "link1" nil 'new 42 nil nil | 48 | "link1" nil 'new 42 nil nil |
| 70 | ((guid "myguid")))))) | 49 | ((guid "myguid")))))) |
| 71 | (assert (newsticker--cache-contains newsticker--cache 'feed1 "WRONGTITLE" | 50 | (should (newsticker--cache-contains newsticker--cache 'feed1 "WRONGTITLE" |
| 72 | "description1" "link1" 'new "myguid")) | 51 | "description1" "link1" 'new "myguid")) |
| 73 | (assert (not (newsticker--cache-contains newsticker--cache 'feed1 "title1" | 52 | (should (not (newsticker--cache-contains newsticker--cache 'feed1 "title1" |
| 74 | "description1" "link1" 'new | 53 | "description1" "link1" 'new |
| 75 | "WRONG GUID"))) | 54 | "WRONG GUID"))) |
| 76 | (assert (newsticker--cache-contains newsticker--cache 'feed1 "title1" | 55 | (should (newsticker--cache-contains newsticker--cache 'feed1 "title1" |
| 77 | "description1" "link1" 'new "myguid"))) | 56 | "description1" "link1" 'new "myguid"))) |
| 78 | (let ((newsticker--cache '((feed1 | 57 | (let ((newsticker--cache '((feed1 |
| 79 | ("title1" "description1" "link1" nil 'new 42 | 58 | ("title1" "description1" "link1" nil 'new 42 |
| 80 | nil nil ((guid () "myguid1"))) | 59 | nil nil ((guid () "myguid1"))) |
| 81 | ("title1" "description1" "link1" nil 'new 42 | 60 | ("title1" "description1" "link1" nil 'new 42 |
| 82 | nil nil ((guid () "myguid2"))))))) | 61 | nil nil ((guid () "myguid2"))))))) |
| 83 | (assert (not (newsticker--cache-contains newsticker--cache 'feed1 "title1" | 62 | (should (not (newsticker--cache-contains newsticker--cache 'feed1 "title1" |
| 84 | "description1" "link1" 'new | 63 | "description1" "link1" 'new |
| 85 | "myguid"))) | 64 | "myguid"))) |
| 86 | (assert (string= "myguid1" | 65 | (should (string= "myguid1" |
| 87 | (newsticker--guid (newsticker--cache-contains | 66 | (newsticker--guid (newsticker--cache-contains |
| 88 | newsticker--cache 'feed1 "title1" | 67 | newsticker--cache 'feed1 "title1" |
| 89 | "description1" "link1" 'new | 68 | "description1" "link1" 'new |
| 90 | "myguid1")))) | 69 | "myguid1")))) |
| 91 | (assert (string= "myguid2" | 70 | (should (string= "myguid2" |
| 92 | (newsticker--guid (newsticker--cache-contains | 71 | (newsticker--guid (newsticker--cache-contains |
| 93 | newsticker--cache 'feed1 "title1" | 72 | newsticker--cache 'feed1 "title1" |
| 94 | "description1" "link1" 'new | 73 | "description1" "link1" 'new |
| 95 | "myguid2")))))) | 74 | "myguid2")))))) |
| 96 | 75 | ||
| 97 | (defun newsticker--do-test--decode-iso8601-date (input expected) | 76 | (defun newsticker-tests--decode-iso8601-date (input expected) |
| 98 | "Actually test `newsticker--decode-iso8601-date'. | 77 | "Actually test `newsticker--decode-iso8601-date'. |
| 99 | Signals an error if iso8601-encoded INPUT does not match EXPECTED." | 78 | Apply to INPUT and compare with EXPECTED." |
| 100 | (let ((result (format-time-string "%Y-%m-%dT%H:%M:%S" | 79 | (let ((result (format-time-string "%Y-%m-%dT%H:%M:%S" |
| 101 | (newsticker--decode-iso8601-date input) | 80 | (newsticker--decode-iso8601-date input) |
| 102 | t))) | 81 | t))) |
| 103 | (assert (string= result expected) | 82 | (should (string= result expected)))) |
| 104 | nil "Error decoding '%s': found '%s' but expected '%s'." | ||
| 105 | input result expected))) | ||
| 106 | 83 | ||
| 107 | (defun newsticker--test--decode-iso8601-date () | 84 | (ert-deftest newsticker--decode-iso8601-date () |
| 108 | "Test `newsticker--decode-iso8601-date'." | 85 | "Test `newsticker--decode-iso8601-date'." |
| 109 | (newsticker--decode-iso8601-date "2004-09-17T05:09:49+00:00") | 86 | (newsticker-tests--decode-iso8601-date "2004" |
| 110 | (newsticker--decode-iso8601-date "2004-09-17T05:09+00:00") | 87 | "2004-01-01T00:00:00") |
| 111 | (newsticker--decode-iso8601-date "2004-09-17T05:09:49") | 88 | (newsticker-tests--decode-iso8601-date "2004-09" |
| 112 | (newsticker--decode-iso8601-date "2004-09-17T05:09") | 89 | "2004-09-01T00:00:00") |
| 113 | (newsticker--decode-iso8601-date "2004-09-17") | 90 | (newsticker-tests--decode-iso8601-date "2004-09-17" |
| 114 | (newsticker--decode-iso8601-date "2004-09") | 91 | "2004-09-17T00:00:00") |
| 115 | (newsticker--do-test--decode-iso8601-date "2004" | 92 | (newsticker-tests--decode-iso8601-date "2004-09-17T05:09" |
| 116 | "2004-01-01T00:00:00") | 93 | "2004-09-17T05:09:00") |
| 117 | (newsticker--do-test--decode-iso8601-date "2004-09" | 94 | (newsticker-tests--decode-iso8601-date "2004-09-17T05:09:49" |
| 118 | "2004-09-01T00:00:00") | 95 | "2004-09-17T05:09:49") |
| 119 | (newsticker--do-test--decode-iso8601-date "2004-09-17" | 96 | (newsticker-tests--decode-iso8601-date "2004-09-17T05:09:49.123" |
| 120 | "2004-09-17T00:00:00") | 97 | "2004-09-17T05:09:49") |
| 121 | (newsticker--do-test--decode-iso8601-date "2004-09-17T05:09" | 98 | (newsticker-tests--decode-iso8601-date "2004-09-17T05:09+01:00" |
| 122 | "2004-09-17T05:09:00") | 99 | "2004-09-17T04:09:00") |
| 123 | (newsticker--do-test--decode-iso8601-date "2004-09-17T05:09:49" | 100 | (newsticker-tests--decode-iso8601-date "2004-09-17T05:09-02:00" |
| 124 | "2004-09-17T05:09:49") | 101 | "2004-09-17T07:09:00")) |
| 125 | (newsticker--do-test--decode-iso8601-date "2004-09-17T05:09:49.123" | ||
| 126 | "2004-09-17T05:09:49") | ||
| 127 | (newsticker--do-test--decode-iso8601-date "2004-09-17T05:09+01:00" | ||
| 128 | "2004-09-17T04:09:00") | ||
| 129 | (newsticker--do-test--decode-iso8601-date "2004-09-17T05:09-02:00" | ||
| 130 | "2004-09-17T07:09:00")) | ||
| 131 | 102 | ||
| 132 | (defun newsticker--do-test--decode-rfc822-date (input expected) | 103 | (defun newsticker--do-test--decode-rfc822-date (input expected) |
| 133 | "Actually test `newsticker--decode-rfc822-date'. | 104 | "Actually test `newsticker--decode-rfc822-date'. |
| 134 | Signals an error if rfc822-encoded INPUT does not match EXPECTED." | 105 | Apply to INPUT and compare with EXPECTED." |
| 135 | (let ((result (format-time-string "%Y-%m-%dT%H:%M:%S" | 106 | (let ((result (format-time-string "%Y-%m-%dT%H:%M:%S" |
| 136 | (newsticker--decode-rfc822-date input) | 107 | (newsticker--decode-rfc822-date input) |
| 137 | t))) | 108 | t))) |
| 138 | (assert (string= result expected) | 109 | (should (string= result expected)))) |
| 139 | nil "Error decoding '%s': found '%s' but expected '%s'." | ||
| 140 | input result expected))) | ||
| 141 | 110 | ||
| 142 | (defun newsticker--test--decode-rfc822-date () | 111 | (ert-deftest newsticker--decode-rfc822-date () |
| 143 | "Test `newsticker--decode-rfc822-date'." | 112 | "Test `newsticker--decode-rfc822-date'." |
| 144 | (newsticker--do-test--decode-rfc822-date "Mon, 10 Mar 2008 19:27:52 +0100" | 113 | (newsticker--do-test--decode-rfc822-date "Mon, 10 Mar 2008 19:27:52 +0100" |
| 145 | "2008-03-10T18:27:52") | 114 | "2008-03-10T18:27:52") |
| @@ -164,16 +133,16 @@ Signals an error if rfc822-encoded INPUT does not match EXPECTED." | |||
| 164 | ;; ====================================================================== | 133 | ;; ====================================================================== |
| 165 | ;; Tests for newsticker-treeview | 134 | ;; Tests for newsticker-treeview |
| 166 | ;; ====================================================================== | 135 | ;; ====================================================================== |
| 167 | (defun newsticker--test--group-manage-orphan-feeds () | 136 | (ert-deftest newsticker--group-manage-orphan-feeds () |
| 168 | "Test `newsticker--group-manage-orphan-feeds'. | 137 | "Test `newsticker--group-manage-orphan-feeds'. |
| 169 | Signals an error if something goes wrong." | 138 | Signals an error if something goes wrong." |
| 170 | (let ((newsticker-groups '("Feeds")) | 139 | (let ((newsticker-groups '("Feeds")) |
| 171 | (newsticker-url-list-defaults nil) | 140 | (newsticker-url-list-defaults nil) |
| 172 | (newsticker-url-list '(("feed1") ("feed2") ("feed3")))) | 141 | (newsticker-url-list '(("feed1") ("feed2") ("feed3")))) |
| 173 | (newsticker--group-manage-orphan-feeds) | 142 | (newsticker--group-manage-orphan-feeds) |
| 174 | (assert (equal '("Feeds" "feed3" "feed2" "feed1") | 143 | (should (equal '("Feeds" "feed3" "feed2" "feed1") |
| 175 | newsticker-groups)))) | 144 | newsticker-groups)))) |
| 176 | 145 | ||
| 177 | (provide 'newsticker-testsuite) | 146 | (provide 'newsticker-tests) |
| 178 | 147 | ||
| 179 | ;;; newsticker-testsuite.el ends here | 148 | ;;; newsticker-tests.el ends here |
diff --git a/test/automated/occur-tests.el b/test/automated/occur-tests.el index 2ae5b1c132f..eb62688d788 100644 --- a/test/automated/occur-tests.el +++ b/test/automated/occur-tests.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; occur-tests.el --- Test suite for occur. | 1 | ;;; occur-tests.el --- Test suite for occur. |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2010-2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2010-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Juri Linkov <juri@jurta.org> | 5 | ;; Author: Juri Linkov <juri@jurta.org> |
| 6 | ;; Keywords: matching, internal | 6 | ;; Keywords: matching, internal |
diff --git a/test/automated/url-future-tests.el b/test/automated/url-future-tests.el new file mode 100644 index 00000000000..d499da6dbe2 --- /dev/null +++ b/test/automated/url-future-tests.el | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | ;;; url-future-tests.el --- Test suite for url-future. | ||
| 2 | |||
| 3 | ;; Copyright (C) 2011-2012 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Teodor Zlatanov <tzz@lifelogs.com> | ||
| 6 | ;; Keywords: data | ||
| 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 | ;;; Code: | ||
| 24 | |||
| 25 | (require 'ert) | ||
| 26 | (require 'url-future) | ||
| 27 | |||
| 28 | (ert-deftest url-future-tests () | ||
| 29 | (let* (saver | ||
| 30 | (text "running future") | ||
| 31 | (good (make-url-future :value (lambda () (format text)) | ||
| 32 | :callback (lambda (f) (set 'saver f)))) | ||
| 33 | (bad (make-url-future :value (lambda () (/ 1 0)) | ||
| 34 | :errorback (lambda (&rest d) (set 'saver d)))) | ||
| 35 | (tocancel (make-url-future :value (lambda () (/ 1 0)) | ||
| 36 | :callback (lambda (f) (set 'saver f)) | ||
| 37 | :errorback (lambda (&rest d) | ||
| 38 | (set 'saver d))))) | ||
| 39 | (should (equal good (url-future-call good))) | ||
| 40 | (should (equal good saver)) | ||
| 41 | (should (equal text (url-future-value good))) | ||
| 42 | (should (url-future-completed-p good)) | ||
| 43 | (should-error (url-future-call good)) | ||
| 44 | (setq saver nil) | ||
| 45 | (should (equal bad (url-future-call bad))) | ||
| 46 | (should-error (url-future-call bad)) | ||
| 47 | (should (equal saver (list bad '(arith-error)))) | ||
| 48 | (should (url-future-errored-p bad)) | ||
| 49 | (setq saver nil) | ||
| 50 | (should (equal (url-future-cancel tocancel) tocancel)) | ||
| 51 | (should-error (url-future-call tocancel)) | ||
| 52 | (should (null saver)) | ||
| 53 | (should (url-future-cancelled-p tocancel)))) | ||
| 54 | |||
| 55 | (provide 'url-future-tests) | ||
| 56 | |||
| 57 | ;;; url-future-tests.el ends here | ||
diff --git a/test/automated/vc-bzr.el b/test/automated/vc-bzr.el new file mode 100644 index 00000000000..904ab4d1304 --- /dev/null +++ b/test/automated/vc-bzr.el | |||
| @@ -0,0 +1,101 @@ | |||
| 1 | ;;; vc-bzr.el --- tests for vc/vc-bzr.el | ||
| 2 | |||
| 3 | ;; Copyright (C) 2011-2012 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Glenn Morris <rgm@gnu.org> | ||
| 6 | |||
| 7 | ;; This file is part of GNU Emacs. | ||
| 8 | |||
| 9 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 10 | ;; it under the terms of the GNU General Public License as published by | ||
| 11 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 12 | ;; (at your option) any later version. | ||
| 13 | |||
| 14 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 15 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | ;; GNU General Public License for more details. | ||
| 18 | |||
| 19 | ;; You should have received a copy of the GNU General Public License | ||
| 20 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 21 | |||
| 22 | ;;; Commentary: | ||
| 23 | |||
| 24 | ;;; Code: | ||
| 25 | |||
| 26 | (require 'ert) | ||
| 27 | (require 'vc-bzr) | ||
| 28 | (require 'vc-dir) | ||
| 29 | |||
| 30 | ;; FIXME it would be better to skip all these tests if there is no | ||
| 31 | ;; bzr installed. We could just put everything inside an IF | ||
| 32 | ;; statement, but it would be nice if ERT had a "skipped" facility (?). | ||
| 33 | |||
| 34 | (ert-deftest vc-bzr-test-bug9726 () | ||
| 35 | "Test for http://debbugs.gnu.org/9726 ." | ||
| 36 | :expected-result (if (executable-find vc-bzr-program) :passed :failed) | ||
| 37 | (should (executable-find vc-bzr-program)) | ||
| 38 | (let* ((tempdir (make-temp-file "vc-bzr-test" t)) | ||
| 39 | (ignored-dir (expand-file-name "ignored-dir" tempdir)) | ||
| 40 | (default-directory (file-name-as-directory tempdir))) | ||
| 41 | (unwind-protect | ||
| 42 | (progn | ||
| 43 | (make-directory ignored-dir) | ||
| 44 | (with-temp-buffer | ||
| 45 | (insert (file-name-nondirectory ignored-dir)) | ||
| 46 | (write-region nil nil (expand-file-name ".bzrignore" tempdir) | ||
| 47 | nil 'silent)) | ||
| 48 | (call-process vc-bzr-program nil nil nil "init") | ||
| 49 | (call-process vc-bzr-program nil nil nil "add") | ||
| 50 | (call-process vc-bzr-program nil nil nil "commit" "-m" "Commit 1") | ||
| 51 | (with-temp-buffer | ||
| 52 | (insert "unregistered file") | ||
| 53 | (write-region nil nil (expand-file-name "testfile2" ignored-dir) | ||
| 54 | nil 'silent)) | ||
| 55 | (vc-dir ignored-dir) | ||
| 56 | (while (vc-dir-busy) | ||
| 57 | (sit-for 0.1)) | ||
| 58 | ;; FIXME better to explicitly test for error from process sentinel. | ||
| 59 | (with-current-buffer "*vc-dir*" | ||
| 60 | (goto-char (point-min)) | ||
| 61 | (should (search-forward "unregistered" nil t)))) | ||
| 62 | (delete-directory tempdir t)))) | ||
| 63 | |||
| 64 | ;; Not specific to bzr. | ||
| 65 | (ert-deftest vc-bzr-test-bug9781 () | ||
| 66 | "Test for http://debbugs.gnu.org/9781 ." | ||
| 67 | :expected-result (if (executable-find vc-bzr-program) :passed :failed) | ||
| 68 | (should (executable-find vc-bzr-program)) | ||
| 69 | (let* ((tempdir (make-temp-file "vc-bzr-test" t)) | ||
| 70 | (subdir (expand-file-name "subdir" tempdir)) | ||
| 71 | (file (expand-file-name "file" tempdir)) | ||
| 72 | (default-directory (file-name-as-directory tempdir))) | ||
| 73 | (unwind-protect | ||
| 74 | (progn | ||
| 75 | (call-process vc-bzr-program nil nil nil "init") | ||
| 76 | (make-directory subdir) | ||
| 77 | (with-temp-buffer | ||
| 78 | (insert "text") | ||
| 79 | (write-region nil nil file nil 'silent) | ||
| 80 | (write-region nil nil (expand-file-name "subfile" subdir) | ||
| 81 | nil 'silent)) | ||
| 82 | (call-process vc-bzr-program nil nil nil "add") | ||
| 83 | (call-process vc-bzr-program nil nil nil "commit" "-m" "Commit 1") | ||
| 84 | (call-process vc-bzr-program nil nil nil "remove" subdir) | ||
| 85 | (with-temp-buffer | ||
| 86 | (insert "different text") | ||
| 87 | (write-region nil nil file nil 'silent)) | ||
| 88 | (vc-dir tempdir) | ||
| 89 | (while (vc-dir-busy) | ||
| 90 | (sit-for 0.1)) | ||
| 91 | (vc-dir-mark-all-files t) | ||
| 92 | (let ((f (symbol-function 'y-or-n-p))) | ||
| 93 | (unwind-protect | ||
| 94 | (progn | ||
| 95 | (fset 'y-or-n-p (lambda (prompt) t)) | ||
| 96 | (vc-next-action nil)) | ||
| 97 | (fset 'y-or-n-p f))) | ||
| 98 | (should (get-buffer "*vc-log*"))) | ||
| 99 | (delete-directory tempdir t)))) | ||
| 100 | |||
| 101 | ;;; vc-bzr.el ends here | ||
diff --git a/test/cedet/cedet-utests.el b/test/cedet/cedet-utests.el index d161ae68fcb..f5df51dc4c9 100644 --- a/test/cedet/cedet-utests.el +++ b/test/cedet/cedet-utests.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; cedet-utests.el --- Run all unit tests in the CEDET suite. | 1 | ;;; cedet-utests.el --- Run all unit tests in the CEDET suite. |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2008-2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2008-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Eric M. Ludlam <eric@siege-engine.com> | 5 | ;; Author: Eric M. Ludlam <eric@siege-engine.com> |
| 6 | 6 | ||
| @@ -96,7 +96,7 @@ | |||
| 96 | "Non-nil when CEDET-utest is running all the tests.") | 96 | "Non-nil when CEDET-utest is running all the tests.") |
| 97 | 97 | ||
| 98 | (defun cedet-utest (&optional exit-on-error) | 98 | (defun cedet-utest (&optional exit-on-error) |
| 99 | "Run the CEDET unittests. | 99 | "Run the CEDET unit tests. |
| 100 | EXIT-ON-ERROR causes the test suite to exit on an error, instead | 100 | EXIT-ON-ERROR causes the test suite to exit on an error, instead |
| 101 | of just logging the error." | 101 | of just logging the error." |
| 102 | (interactive) | 102 | (interactive) |
diff --git a/test/cedet/ede-tests.el b/test/cedet/ede-tests.el index f07098a8a9a..f73e4bed63f 100644 --- a/test/cedet/ede-tests.el +++ b/test/cedet/ede-tests.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; ede-tests.el --- Some tests for the Emacs Development Environment | 1 | ;;; ede-tests.el --- Some tests for the Emacs Development Environment |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2008-2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2008-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Eric M. Ludlam <eric@siege-engine.com> | 5 | ;; Author: Eric M. Ludlam <eric@siege-engine.com> |
| 6 | 6 | ||
diff --git a/test/cedet/semantic-ia-utest.el b/test/cedet/semantic-ia-utest.el index 765029151dc..c523e103669 100644 --- a/test/cedet/semantic-ia-utest.el +++ b/test/cedet/semantic-ia-utest.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; semantic-ia-utest.el --- Analyzer unit tests | 1 | ;;; semantic-ia-utest.el --- Analyzer unit tests |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2008-2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2008-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Eric M. Ludlam <eric@siege-engine.com> | 5 | ;; Author: Eric M. Ludlam <eric@siege-engine.com> |
| 6 | 6 | ||
diff --git a/test/cedet/semantic-tests.el b/test/cedet/semantic-tests.el index c840993bf24..22b959016c1 100644 --- a/test/cedet/semantic-tests.el +++ b/test/cedet/semantic-tests.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; semantic-utest.el --- Miscellaneous Semantic tests. | 1 | ;;; semantic-utest.el --- Miscellaneous Semantic tests. |
| 2 | 2 | ||
| 3 | ;;; Copyright (C) 2003-2004, 2007-2011 Free Software Foundation, Inc. | 3 | ;;; Copyright (C) 2003-2004, 2007-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Eric M. Ludlam <zappo@gnu.org> | 5 | ;; Author: Eric M. Ludlam <zappo@gnu.org> |
| 6 | 6 | ||
| @@ -54,7 +54,7 @@ All systems are different. Ask questions along the way." | |||
| 54 | (y-or-n-p "New database created. Reload system databases? ") | 54 | (y-or-n-p "New database created. Reload system databases? ") |
| 55 | (y-or-n-p "Load in all system databases? ")) | 55 | (y-or-n-p "Load in all system databases? ")) |
| 56 | (semanticdb-load-ebrowse-caches))) | 56 | (semanticdb-load-ebrowse-caches))) |
| 57 | ;; Ok, databases were creatd. Lets try some searching. | 57 | ;; Ok, databases were created. Let's try some searching. |
| 58 | (when (not (or (eq major-mode 'c-mode) | 58 | (when (not (or (eq major-mode 'c-mode) |
| 59 | (eq major-mode 'c++-mode))) | 59 | (eq major-mode 'c++-mode))) |
| 60 | (error "Please make your default buffer be a C or C++ file, then | 60 | (error "Please make your default buffer be a C or C++ file, then |
| @@ -387,4 +387,3 @@ gcc version 2.95.2 19991024 (release)" | |||
| 387 | (let ((semantic-gcc-test-strings (list (semantic-gcc-query "gcc" "-v")))) | 387 | (let ((semantic-gcc-test-strings (list (semantic-gcc-query "gcc" "-v")))) |
| 388 | (semantic-gcc-test-output-parser)) | 388 | (semantic-gcc-test-output-parser)) |
| 389 | ) | 389 | ) |
| 390 | |||
diff --git a/test/cedet/semantic-utest-c.el b/test/cedet/semantic-utest-c.el index 946a818e70e..c500f543187 100644 --- a/test/cedet/semantic-utest-c.el +++ b/test/cedet/semantic-utest-c.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; semantic-utest-c.el --- C based parsing tests. | 1 | ;;; semantic-utest-c.el --- C based parsing tests. |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2008-2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2008-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Eric M. Ludlam <eric@siege-engine.com> | 5 | ;; Author: Eric M. Ludlam <eric@siege-engine.com> |
| 6 | 6 | ||
| @@ -28,7 +28,7 @@ | |||
| 28 | (defvar semantic-utest-c-comparisons | 28 | (defvar semantic-utest-c-comparisons |
| 29 | '( ("testsppreplace.c" . "testsppreplaced.c") | 29 | '( ("testsppreplace.c" . "testsppreplaced.c") |
| 30 | ) | 30 | ) |
| 31 | "List of files to parse and compare against eachother.") | 31 | "List of files to parse and compare against each other.") |
| 32 | 32 | ||
| 33 | ;;; Code: | 33 | ;;; Code: |
| 34 | ;;;###autoload | 34 | ;;;###autoload |
diff --git a/test/cedet/semantic-utest.el b/test/cedet/semantic-utest.el index a9a7c765f2b..728106d863c 100644 --- a/test/cedet/semantic-utest.el +++ b/test/cedet/semantic-utest.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; semantic-utest.el --- Tests for semantic's parsing system. | 1 | ;;; semantic-utest.el --- Tests for semantic's parsing system. |
| 2 | 2 | ||
| 3 | ;;; Copyright (C) 2003-2004, 2007-2011 Free Software Foundation, Inc. | 3 | ;;; Copyright (C) 2003-2004, 2007-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Eric M. Ludlam <zappo@gnu.org> | 5 | ;; Author: Eric M. Ludlam <zappo@gnu.org> |
| 6 | 6 | ||
| @@ -170,7 +170,7 @@ def fun2(a,b,c): #1 | |||
| 170 | 170 | ||
| 171 | 171 | ||
| 172 | ) | 172 | ) |
| 173 | ; "pyhon test case. notice that python is indentation sensitive | 173 | ; "python test case. notice that python is indentation sensitive |
| 174 | 174 | ||
| 175 | 175 | ||
| 176 | (defvar semantic-utest-Python-name-contents | 176 | (defvar semantic-utest-Python-name-contents |
| @@ -536,7 +536,7 @@ Pre-fill the buffer with CONTENTS." | |||
| 536 | 536 | ||
| 537 | (defun semantic-utest-generic (testname filename contents name-contents names-removed killme insertme) | 537 | (defun semantic-utest-generic (testname filename contents name-contents names-removed killme insertme) |
| 538 | "Generic unit test according to template. | 538 | "Generic unit test according to template. |
| 539 | Should work for languages withouth .h files, python javascript java. | 539 | Should work for languages without .h files, python javascript java. |
| 540 | TESTNAME is the name of the test. | 540 | TESTNAME is the name of the test. |
| 541 | FILENAME is the name of the file to create. | 541 | FILENAME is the name of the file to create. |
| 542 | CONTENTS is the contents of the file to test. | 542 | CONTENTS is the contents of the file to test. |
| @@ -622,7 +622,7 @@ INSERTME is the text to be inserted after the deletion." | |||
| 622 | ) | 622 | ) |
| 623 | 623 | ||
| 624 | ;look at http://mfgames.com/linux/csharp-mode | 624 | ;look at http://mfgames.com/linux/csharp-mode |
| 625 | (defun semantic-utest-Csharp() ;; hmm i dont even know how to edit a scharp file. need a csharp mode implementation i suppose | 625 | (defun semantic-utest-Csharp() ;; hmm i don't even know how to edit a scharp file. need a csharp mode implementation i suppose |
| 626 | (interactive) | 626 | (interactive) |
| 627 | (if (fboundp 'csharp-mode) | 627 | (if (fboundp 'csharp-mode) |
| 628 | (semantic-utest-generic "C#" (semantic-utest-fname "csharptest.cs") semantic-utest-Csharp-buffer-contents semantic-utest-Csharp-name-contents '("fun2") "//1" "//deleted line") | 628 | (semantic-utest-generic "C#" (semantic-utest-fname "csharptest.cs") semantic-utest-Csharp-buffer-contents semantic-utest-Csharp-name-contents '("fun2") "//1" "//deleted line") |
| @@ -787,7 +787,7 @@ SKIPNAMES is a list of names to remove from NAME-CONTENTS" | |||
| 787 | (defun semantic-utest-kill-indicator ( killme insertme) | 787 | (defun semantic-utest-kill-indicator ( killme insertme) |
| 788 | "Kill the line with KILLME on it and insert INSERTME in its place." | 788 | "Kill the line with KILLME on it and insert INSERTME in its place." |
| 789 | (goto-char (point-min)) | 789 | (goto-char (point-min)) |
| 790 | ; (re-search-forward (concat "/\\*" indicator "\\*/")); JAVE this isnt generic enough for different lagnuages | 790 | ; (re-search-forward (concat "/\\*" indicator "\\*/")); JAVE this isn't generic enough for different languages |
| 791 | (re-search-forward killme) | 791 | (re-search-forward killme) |
| 792 | (beginning-of-line) | 792 | (beginning-of-line) |
| 793 | (setq semantic-utest-last-kill-pos (point)) | 793 | (setq semantic-utest-last-kill-pos (point)) |
| @@ -812,7 +812,7 @@ SKIPNAMES is a list of names to remove from NAME-CONTENTS" | |||
| 812 | (defun semantic-utest-last-invalid (name-contents names-removed killme insertme) | 812 | (defun semantic-utest-last-invalid (name-contents names-removed killme insertme) |
| 813 | "Make the last fcn invalid." | 813 | "Make the last fcn invalid." |
| 814 | (semantic-utest-kill-indicator killme insertme) | 814 | (semantic-utest-kill-indicator killme insertme) |
| 815 | ; (semantic-utest-verify-names name-contents names-removed); verify its gone ;new validator doesnt handle skipnames yet | 815 | ; (semantic-utest-verify-names name-contents names-removed); verify its gone ;new validator doesn't handle skipnames yet |
| 816 | (semantic-utest-unkill-indicator);put back killed stuff | 816 | (semantic-utest-unkill-indicator);put back killed stuff |
| 817 | ) | 817 | ) |
| 818 | 818 | ||
diff --git a/test/cedet/srecode-tests.el b/test/cedet/srecode-tests.el index 10b06f5cd01..d0239f627b3 100644 --- a/test/cedet/srecode-tests.el +++ b/test/cedet/srecode-tests.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; srecode-tests.el --- Some tests for CEDET's srecode | 1 | ;;; srecode-tests.el --- Some tests for CEDET's srecode |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2008-2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2008-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Eric M. Ludlam <eric@siege-engine.com> | 5 | ;; Author: Eric M. Ludlam <eric@siege-engine.com> |
| 6 | 6 | ||
| @@ -177,7 +177,7 @@ It is filled with some text." | |||
| 177 | 177 | ||
| 178 | (mapc (lambda (T) | 178 | (mapc (lambda (T) |
| 179 | (when (slot-boundp T 'overlay) | 179 | (when (slot-boundp T 'overlay) |
| 180 | (error "Overlay did not clear off of of field %s" | 180 | (error "Overlay did not clear off of field %s" |
| 181 | (object-name T)))) | 181 | (object-name T)))) |
| 182 | fields) | 182 | fields) |
| 183 | 183 | ||
diff --git a/test/cedet/tests/test.c b/test/cedet/tests/test.c index 6f96f794915..b2d9971ff4f 100644 --- a/test/cedet/tests/test.c +++ b/test/cedet/tests/test.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* test.c --- Semantic unit test for C. | 1 | /* test.c --- Semantic unit test for C. |
| 2 | 2 | ||
| 3 | Copyright (C) 2001-2011 Free Software Foundation, Inc. | 3 | Copyright (C) 2001-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | Author: Eric M. Ludlam <eric@siege-engine.com> | 5 | Author: Eric M. Ludlam <eric@siege-engine.com> |
| 6 | 6 | ||
diff --git a/test/cedet/tests/test.el b/test/cedet/tests/test.el index 8a95572c497..a07a9316f35 100644 --- a/test/cedet/tests/test.el +++ b/test/cedet/tests/test.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; test.el --- Unit test file for Semantic Emacs Lisp support. | 1 | ;;; test.el --- Unit test file for Semantic Emacs Lisp support. |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2005-2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2005-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Eric M. Ludlam <eric@siege-engine.com> | 5 | ;; Author: Eric M. Ludlam <eric@siege-engine.com> |
| 6 | 6 | ||
| @@ -144,7 +144,7 @@ | |||
| 144 | this | 144 | this |
| 145 | that) | 145 | that) |
| 146 | 146 | ||
| 147 | (define-mode-local-override a-overriden-function | 147 | (define-mode-local-override a-overridden-function |
| 148 | emacs-lisp-mode (tag) | 148 | emacs-lisp-mode (tag) |
| 149 | "A function that is overloaded." | 149 | "A function that is overloaded." |
| 150 | nil) | 150 | nil) |
diff --git a/test/cedet/tests/test.make b/test/cedet/tests/test.make index a8a3e344cad..cc9d450c1e0 100644 --- a/test/cedet/tests/test.make +++ b/test/cedet/tests/test.make | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | # test.make --- Semantic unit test for Make -*- makefile -*- | 1 | # test.make --- Semantic unit test for Make -*- makefile -*- |
| 2 | 2 | ||
| 3 | # Copyright (C) 2001-2002, 2010-2011 Free Software Foundation, Inc. | 3 | # Copyright (C) 2001-2002, 2010-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | # Author: Eric M. Ludlam <eric@siege-engine.com> | 5 | # Author: Eric M. Ludlam <eric@siege-engine.com> |
| 6 | 6 | ||
diff --git a/test/cedet/tests/testdoublens.cpp b/test/cedet/tests/testdoublens.cpp index c0993af0863..72a7e10dc5a 100644 --- a/test/cedet/tests/testdoublens.cpp +++ b/test/cedet/tests/testdoublens.cpp | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // testdoublens.cpp --- semantic-ia-utest completion engine unit tests | 1 | // testdoublens.cpp --- semantic-ia-utest completion engine unit tests |
| 2 | 2 | ||
| 3 | // Copyright (C) 2008-2011 Free Software Foundation, Inc. | 3 | // Copyright (C) 2008-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | // Author: Eric M. Ludlam <eric@siege-engine.com> | 5 | // Author: Eric M. Ludlam <eric@siege-engine.com> |
| 6 | 6 | ||
diff --git a/test/cedet/tests/testdoublens.hpp b/test/cedet/tests/testdoublens.hpp index 94349ed8544..69475ee3c19 100644 --- a/test/cedet/tests/testdoublens.hpp +++ b/test/cedet/tests/testdoublens.hpp | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // testdoublens.hpp --- Header file used in one of the Semantic tests | 1 | // testdoublens.hpp --- Header file used in one of the Semantic tests |
| 2 | 2 | ||
| 3 | // Copyright (C) 2008-2011 Free Software Foundation, Inc. | 3 | // Copyright (C) 2008-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | // Author: Eric M. Ludlam <eric@siege-engine.com> | 5 | // Author: Eric M. Ludlam <eric@siege-engine.com> |
| 6 | 6 | ||
diff --git a/test/cedet/tests/testjavacomp.java b/test/cedet/tests/testjavacomp.java index e9aed8c51f3..54b9f4aa004 100644 --- a/test/cedet/tests/testjavacomp.java +++ b/test/cedet/tests/testjavacomp.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // testjavacomp.java --- Semantic unit test for Java | 1 | // testjavacomp.java --- Semantic unit test for Java |
| 2 | 2 | ||
| 3 | // Copyright (C) 2009-2011 Free Software Foundation, Inc. | 3 | // Copyright (C) 2009-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | // Author: Eric M. Ludlam <eric@siege-engine.com> | 5 | // Author: Eric M. Ludlam <eric@siege-engine.com> |
| 6 | 6 | ||
diff --git a/test/cedet/tests/testpolymorph.cpp b/test/cedet/tests/testpolymorph.cpp index 493b4344c17..2108da14e56 100644 --- a/test/cedet/tests/testpolymorph.cpp +++ b/test/cedet/tests/testpolymorph.cpp | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /** testpolymorph.cpp --- A sequence of polymorphism examples. | 1 | /** testpolymorph.cpp --- A sequence of polymorphism examples. |
| 2 | * | 2 | * |
| 3 | * Copyright (C) 2009-2011 Free Software Foundation, Inc. | 3 | * Copyright (C) 2009-2012 Free Software Foundation, Inc. |
| 4 | * | 4 | * |
| 5 | * Author: Eric M. Ludlam <eric@siege-engine.com> | 5 | * Author: Eric M. Ludlam <eric@siege-engine.com> |
| 6 | * | 6 | * |
| @@ -50,7 +50,7 @@ namespace fcn_poly { | |||
| 50 | 50 | ||
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | // Test 3 - Methods w/ differet arg lists. | 53 | // Test 3 - Methods w/ different arg lists. |
| 54 | class meth_poly { | 54 | class meth_poly { |
| 55 | public: | 55 | public: |
| 56 | int pm_meth(void) { | 56 | int pm_meth(void) { |
| @@ -83,7 +83,7 @@ namespace template_partial_spec { | |||
| 83 | }; | 83 | }; |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | // Test 5 - Templates w/ full specicialization which may or may not share | 86 | // Test 5 - Templates w/ full specialization which may or may not share |
| 87 | // common functions. | 87 | // common functions. |
| 88 | namespace template_full_spec { | 88 | namespace template_full_spec { |
| 89 | template <typename T> class test | 89 | template <typename T> class test |
| @@ -128,4 +128,3 @@ namespace template_multiple_spec { | |||
| 128 | 128 | ||
| 129 | 129 | ||
| 130 | // End of polymorphism test file. | 130 | // End of polymorphism test file. |
| 131 | |||
diff --git a/test/cedet/tests/testspp.c b/test/cedet/tests/testspp.c index 1cd45e47e1f..1fbabd62d14 100644 --- a/test/cedet/tests/testspp.c +++ b/test/cedet/tests/testspp.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* testspp.cpp --- Semantic unit test for the C preprocessor | 1 | /* testspp.cpp --- Semantic unit test for the C preprocessor |
| 2 | 2 | ||
| 3 | Copyright (C) 2007-2011 Free Software Foundation, Inc. | 3 | Copyright (C) 2007-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | Author: Eric M. Ludlam <eric@siege-engine.com> | 5 | Author: Eric M. Ludlam <eric@siege-engine.com> |
| 6 | 6 | ||
diff --git a/test/cedet/tests/testsppreplace.c b/test/cedet/tests/testsppreplace.c index 4ec87654dc4..36b4cb5fa57 100644 --- a/test/cedet/tests/testsppreplace.c +++ b/test/cedet/tests/testsppreplace.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* testsppreplace.c --- unit test for CPP/SPP Replacement | 1 | /* testsppreplace.c --- unit test for CPP/SPP Replacement |
| 2 | Copyright (C) 2007-2011 Free Software Foundation, Inc. | 2 | Copyright (C) 2007-2012 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | Author: Eric M. Ludlam <eric@siege-engine.com> | 4 | Author: Eric M. Ludlam <eric@siege-engine.com> |
| 5 | 5 | ||
diff --git a/test/cedet/tests/testsppreplaced.c b/test/cedet/tests/testsppreplaced.c index 5098715081f..19e3b7ec869 100644 --- a/test/cedet/tests/testsppreplaced.c +++ b/test/cedet/tests/testsppreplaced.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* testsppreplaced.c --- unit test for CPP/SPP Replacement | 1 | /* testsppreplaced.c --- unit test for CPP/SPP Replacement |
| 2 | Copyright (C) 2007-2011 Free Software Foundation, Inc. | 2 | Copyright (C) 2007-2012 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | Author: Eric M. Ludlam <eric@siege-engine.com> | 4 | Author: Eric M. Ludlam <eric@siege-engine.com> |
| 5 | 5 | ||
| @@ -69,7 +69,7 @@ int continuation_symbol () { }; | |||
| 69 | 69 | ||
| 70 | int tail (int q) {} | 70 | int tail (int q) {} |
| 71 | 71 | ||
| 72 | /* TEST: macros used impropertly. */ | 72 | /* TEST: macros used improperly */ |
| 73 | 73 | ||
| 74 | int tail_fcn(int q); | 74 | int tail_fcn(int q); |
| 75 | 75 | ||
| @@ -98,7 +98,7 @@ namespace foo { namespace bar { | |||
| 98 | 98 | ||
| 99 | int foo_bar_func(int a) { } | 99 | int foo_bar_func(int a) { } |
| 100 | 100 | ||
| 101 | } | 101 | } |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | /* TEST: The VC++ macro hack. */ | 104 | /* TEST: The VC++ macro hack. */ |
| @@ -115,4 +115,3 @@ int MACROA () { | |||
| 115 | 115 | ||
| 116 | 116 | ||
| 117 | /* End */ | 117 | /* End */ |
| 118 | |||
diff --git a/test/cedet/tests/testsubclass.cpp b/test/cedet/tests/testsubclass.cpp index 6a704818b0d..3fb61053a41 100644 --- a/test/cedet/tests/testsubclass.cpp +++ b/test/cedet/tests/testsubclass.cpp | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // testsubclass.cpp --- unit test for analyzer and complex C++ inheritance | 1 | // testsubclass.cpp --- unit test for analyzer and complex C++ inheritance |
| 2 | 2 | ||
| 3 | // Copyright (C) 2007-2011 Free Software Foundation, Inc. | 3 | // Copyright (C) 2007-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | // Author: Eric M. Ludlam <eric@siege-engine.com> | 5 | // Author: Eric M. Ludlam <eric@siege-engine.com> |
| 6 | 6 | ||
diff --git a/test/cedet/tests/testsubclass.hh b/test/cedet/tests/testsubclass.hh index 9e6d777d74d..dee470b899f 100644 --- a/test/cedet/tests/testsubclass.hh +++ b/test/cedet/tests/testsubclass.hh | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // testsubclass.hh --- unit test for analyzer and complex C++ inheritance | 1 | // testsubclass.hh --- unit test for analyzer and complex C++ inheritance |
| 2 | 2 | ||
| 3 | // Copyright (C) 2007-2011 Free Software Foundation, Inc. | 3 | // Copyright (C) 2007-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | // Author: Eric M. Ludlam <eric@siege-engine.com> | 5 | // Author: Eric M. Ludlam <eric@siege-engine.com> |
| 6 | 6 | ||
diff --git a/test/cedet/tests/testtypedefs.cpp b/test/cedet/tests/testtypedefs.cpp index f97b1400454..f3666bea316 100644 --- a/test/cedet/tests/testtypedefs.cpp +++ b/test/cedet/tests/testtypedefs.cpp | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // testtypedefs.cpp --- Sample with some fake bits out of std::string | 1 | // testtypedefs.cpp --- Sample with some fake bits out of std::string |
| 2 | 2 | ||
| 3 | // Copyright (C) 2008-2011 Free Software Foundation, Inc. | 3 | // Copyright (C) 2008-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | // Author: Eric M. Ludlam <eric@siege-engine.com> | 5 | // Author: Eric M. Ludlam <eric@siege-engine.com> |
| 6 | 6 | ||
diff --git a/test/cedet/tests/testvarnames.c b/test/cedet/tests/testvarnames.c index 51d8285730f..5cade2f0bd8 100644 --- a/test/cedet/tests/testvarnames.c +++ b/test/cedet/tests/testvarnames.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* testvarnames.cpp | 1 | /* testvarnames.cpp |
| 2 | Test variable and function names, lists of variables on one line, etc. | 2 | Test variable and function names, lists of variables on one line, etc. |
| 3 | 3 | ||
| 4 | Copyright (C) 2008-2011 Free Software Foundation, Inc. | 4 | Copyright (C) 2008-2012 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | Author: Eric M. Ludlam <eric@siege-engine.com> | 6 | Author: Eric M. Ludlam <eric@siege-engine.com> |
| 7 | 7 | ||
| @@ -31,7 +31,7 @@ struct independent var_indep_struct; | |||
| 31 | struct { | 31 | struct { |
| 32 | int unnamed_1; | 32 | int unnamed_1; |
| 33 | int unnamed_2; | 33 | int unnamed_2; |
| 34 | } var_unamed_struct; | 34 | } var_unnamed_struct; |
| 35 | 35 | ||
| 36 | struct { | 36 | struct { |
| 37 | int unnamed_3; | 37 | int unnamed_3; |
| @@ -59,12 +59,12 @@ struct inline2struct in_var2; | |||
| 59 | int test_1(int var_arg1) { | 59 | int test_1(int var_arg1) { |
| 60 | 60 | ||
| 61 | var_// -1- | 61 | var_// -1- |
| 62 | ; // #1# ("var_arg1" "var_indep_struct" "var_n_2" "var_n_3" "var_named_struct" "var_un_2" "var_un_3" "var_unamed_struct") | 62 | ; // #1# ("var_arg1" "var_indep_struct" "var_n_2" "var_n_3" "var_named_struct" "var_un_2" "var_un_3" "var_unnamed_struct") |
| 63 | 63 | ||
| 64 | var_indep_struct.// -2- | 64 | var_indep_struct.// -2- |
| 65 | ; // #2# ( "indep_1" "indep_2" ) | 65 | ; // #2# ( "indep_1" "indep_2" ) |
| 66 | 66 | ||
| 67 | var_unamed_struct.// -3- | 67 | var_unnamed_struct.// -3- |
| 68 | ; // #3# ( "unnamed_1" "unnamed_2" ) | 68 | ; // #3# ( "unnamed_1" "unnamed_2" ) |
| 69 | 69 | ||
| 70 | var_named_struct.// -4- | 70 | var_named_struct.// -4- |
| @@ -88,4 +88,3 @@ int test_1(int var_arg1) { | |||
| 88 | in_var2.// -11- | 88 | in_var2.// -11- |
| 89 | ; // #11# ( "named_3" "named_4") | 89 | ; // #11# ( "named_3" "named_4") |
| 90 | } | 90 | } |
| 91 | |||
diff --git a/test/eshell.el b/test/eshell.el index 3b392e84c24..7acb34b6029 100644 --- a/test/eshell.el +++ b/test/eshell.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; esh-test.el --- Eshell test suite | 1 | ;;; esh-test.el --- Eshell test suite |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1999-2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1999-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: John Wiegley <johnw@gnu.org> | 5 | ;; Author: John Wiegley <johnw@gnu.org> |
| 6 | 6 | ||
| @@ -396,7 +396,7 @@ | |||
| 396 | (eshell-command-result-p "+ ${+ 1 2} 3" "6\n")) | 396 | (eshell-command-result-p "+ ${+ 1 2} 3" "6\n")) |
| 397 | 397 | ||
| 398 | (eshell-deftest var interp-lisp | 398 | (eshell-deftest var interp-lisp |
| 399 | "Interpolate Lisp form evalution" | 399 | "Interpolate Lisp form evaluation" |
| 400 | (eshell-command-result-p "+ $(+ 1 2) 3" "6\n")) | 400 | (eshell-command-result-p "+ $(+ 1 2) 3" "6\n")) |
| 401 | 401 | ||
| 402 | (eshell-deftest var interp-concat | 402 | (eshell-deftest var interp-concat |
diff --git a/test/indent/octave.m b/test/indent/octave.m index 768f3d85e01..4c2fa6c8435 100644 --- a/test/indent/octave.m +++ b/test/indent/octave.m | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | function res = tcomp (fn) | 3 | function res = tcomp (fn) |
| 4 | %% res = tcomp (fn) | 4 | %% res = tcomp (fn) |
| 5 | %% imports components and rearranges them. | 5 | %% imports components and rearranges them. |
| 6 | 6 | ||
| 7 | if nargin ~= 1 | 7 | if nargin ~= 1 |
| 8 | print_usage() | 8 | print_usage() |
| 9 | end | 9 | end |
| @@ -19,7 +19,7 @@ function res = tcomp (fn) | |||
| 19 | pop = x(:,1:10)(:); | 19 | pop = x(:,1:10)(:); |
| 20 | ## Here and below, we test if the indentation aligns with a previous | 20 | ## Here and below, we test if the indentation aligns with a previous |
| 21 | ## fixindented line. This is important so as to make it easier for the | 21 | ## fixindented line. This is important so as to make it easier for the |
| 22 | ## user to verride some indentation somewhere, and also because it | 22 | ## user to override some indentation somewhere, and also because it |
| 23 | ## reflects the fact that the indentation decision is taken with a minimum | 23 | ## reflects the fact that the indentation decision is taken with a minimum |
| 24 | ## amount of work (i.e. in the present case, without having to walk back | 24 | ## amount of work (i.e. in the present case, without having to walk back |
| 25 | ## until the `function' line). | 25 | ## until the `function' line). |
| @@ -36,7 +36,7 @@ function res = tcomp (fn) | |||
| 36 | endfunction | 36 | endfunction |
| 37 | 37 | ||
| 38 | ## Copyright (C) 2005, 2006, 2007, 2008, 2009 S�ren Hauberg | 38 | ## Copyright (C) 2005, 2006, 2007, 2008, 2009 S�ren Hauberg |
| 39 | ## | 39 | ## |
| 40 | ## This file is part of Octave. | 40 | ## This file is part of Octave. |
| 41 | ## | 41 | ## |
| 42 | ## Octave is free software; you can redistribute it and/or modify it | 42 | ## Octave is free software; you can redistribute it and/or modify it |
| @@ -73,16 +73,16 @@ endfunction | |||
| 73 | ## | 73 | ## |
| 74 | ## @table @code | 74 | ## @table @code |
| 75 | ## @item -nodeps | 75 | ## @item -nodeps |
| 76 | ## The package manager will disable the dependency checking. That way it | 76 | ## The package manager will disable the dependency checking. That way it |
| 77 | ## is possible to install a package even if it depends on another package | 77 | ## is possible to install a package even if it depends on another package |
| 78 | ## that's not installed on the system. @strong{Use this option with care.} | 78 | ## that's not installed on the system. @strong{Use this option with care.} |
| 79 | ## | 79 | ## |
| 80 | ## @item -noauto | 80 | ## @item -noauto |
| 81 | ## The package manager will not automatically load the installed package | 81 | ## The package manager will not automatically load the installed package |
| 82 | ## when starting Octave, even if the package requests that it is. | 82 | ## when starting Octave, even if the package requests that it is. |
| 83 | ## | 83 | ## |
| 84 | ## @item -auto | 84 | ## @item -auto |
| 85 | ## The package manager will automatically load the installed package when | 85 | ## The package manager will automatically load the installed package when |
| 86 | ## starting Octave, even if the package requests that it isn't. | 86 | ## starting Octave, even if the package requests that it isn't. |
| 87 | ## | 87 | ## |
| 88 | ## @item -local | 88 | ## @item -local |
| @@ -93,7 +93,7 @@ endfunction | |||
| 93 | ## system privileges | 93 | ## system privileges |
| 94 | ## | 94 | ## |
| 95 | ## @item -verbose | 95 | ## @item -verbose |
| 96 | ## The package manager will print the output of all of the commands that are | 96 | ## The package manager will print the output of all of the commands that are |
| 97 | ## performed. | 97 | ## performed. |
| 98 | ## @end table | 98 | ## @end table |
| 99 | ## | 99 | ## |
| @@ -205,7 +205,7 @@ endfunction | |||
| 205 | ## pkg global_list | 205 | ## pkg global_list |
| 206 | ## @end example | 206 | ## @end example |
| 207 | ## @item rebuild | 207 | ## @item rebuild |
| 208 | ## Rebuilds the package database from the installed directories. This can | 208 | ## Rebuilds the package database from the installed directories. This can |
| 209 | ## be used in cases where for some reason the package database is corrupted. | 209 | ## be used in cases where for some reason the package database is corrupted. |
| 210 | ## It can also take the @code{-auto} and @code{-noauto} options to allow the | 210 | ## It can also take the @code{-auto} and @code{-noauto} options to allow the |
| 211 | ## autoloading state of a package to be changed. For example | 211 | ## autoloading state of a package to be changed. For example |
| @@ -227,7 +227,7 @@ endfunction | |||
| 227 | ## @noindent | 227 | ## @noindent |
| 228 | ## where @code{builddir} is the name of a directory where the temporary | 228 | ## where @code{builddir} is the name of a directory where the temporary |
| 229 | ## installation will be produced and the binary packages will be found. | 229 | ## installation will be produced and the binary packages will be found. |
| 230 | ## The options @code{-verbose} and @code{-nodeps} are respected, while | 230 | ## The options @code{-verbose} and @code{-nodeps} are respected, while |
| 231 | ## the other options are ignored. | 231 | ## the other options are ignored. |
| 232 | ## @end table | 232 | ## @end table |
| 233 | ## @end deftypefn | 233 | ## @end deftypefn |
| @@ -259,7 +259,7 @@ function [local_packages, global_packages] = pkg (varargin) | |||
| 259 | 259 | ||
| 260 | available_actions = {"list", "install", "uninstall", "load", ... | 260 | available_actions = {"list", "install", "uninstall", "load", ... |
| 261 | "unload", "prefix", "local_list", ... | 261 | "unload", "prefix", "local_list", ... |
| 262 | "global_list", "rebuild", "build","describe"}; | 262 | "global_list", "rebuild", "build","describe"}; |
| 263 | ## Handle input | 263 | ## Handle input |
| 264 | if (length (varargin) == 0 || ! iscellstr (varargin)) | 264 | if (length (varargin) == 0 || ! iscellstr (varargin)) |
| 265 | print_usage (); | 265 | print_usage (); |
| @@ -321,14 +321,14 @@ function [local_packages, global_packages] = pkg (varargin) | |||
| 321 | if (length (files) == 0) | 321 | if (length (files) == 0) |
| 322 | error ("you must specify at least one filename when calling 'pkg install'"); | 322 | error ("you must specify at least one filename when calling 'pkg install'"); |
| 323 | endif | 323 | endif |
| 324 | install (files, deps, auto, prefix, archprefix, verbose, local_list, | 324 | install (files, deps, auto, prefix, archprefix, verbose, local_list, |
| 325 | global_list, global_install); | 325 | global_list, global_install); |
| 326 | 326 | ||
| 327 | case "uninstall" | 327 | case "uninstall" |
| 328 | if (length (files) == 0) | 328 | if (length (files) == 0) |
| 329 | error ("you must specify at least one package when calling 'pkg uninstall'"); | 329 | error ("you must specify at least one package when calling 'pkg uninstall'"); |
| 330 | endif | 330 | endif |
| 331 | uninstall (files, deps, verbose, local_list, | 331 | uninstall (files, deps, verbose, local_list, |
| 332 | global_list, global_install); | 332 | global_list, global_install); |
| 333 | 333 | ||
| 334 | case "load" | 334 | case "load" |
| @@ -406,7 +406,7 @@ function [local_packages, global_packages] = pkg (varargin) | |||
| 406 | 406 | ||
| 407 | case "rebuild" | 407 | case "rebuild" |
| 408 | if (global_install) | 408 | if (global_install) |
| 409 | global_packages = rebuild (prefix, archprefix, global_list, files, | 409 | global_packages = rebuild (prefix, archprefix, global_list, files, |
| 410 | auto, verbose); | 410 | auto, verbose); |
| 411 | global_packages = save_order (global_packages); | 411 | global_packages = save_order (global_packages); |
| 412 | save (global_list, "global_packages"); | 412 | save (global_list, "global_packages"); |
| @@ -414,7 +414,7 @@ function [local_packages, global_packages] = pkg (varargin) | |||
| 414 | local_packages = global_packages; | 414 | local_packages = global_packages; |
| 415 | endif | 415 | endif |
| 416 | else | 416 | else |
| 417 | local_packages = rebuild (prefix, archprefix, local_list, files, auto, | 417 | local_packages = rebuild (prefix, archprefix, local_list, files, auto, |
| 418 | verbose); | 418 | verbose); |
| 419 | local_packages = save_order (local_packages); | 419 | local_packages = save_order (local_packages); |
| 420 | save (local_list, "local_packages"); | 420 | save (local_list, "local_packages"); |
| @@ -450,7 +450,7 @@ function [local_packages, global_packages] = pkg (varargin) | |||
| 450 | otherwise | 450 | otherwise |
| 451 | error ("you can request at most two outputs when calling 'pkg describe'"); | 451 | error ("you can request at most two outputs when calling 'pkg describe'"); |
| 452 | endswitch | 452 | endswitch |
| 453 | 453 | ||
| 454 | otherwise | 454 | otherwise |
| 455 | error ("you must specify a valid action for 'pkg'. See 'help pkg' for details"); | 455 | error ("you must specify a valid action for 'pkg'. See 'help pkg' for details"); |
| 456 | endswitch | 456 | endswitch |
| @@ -529,7 +529,7 @@ function descriptions = rebuild (prefix, archprefix, list, files, auto, verbose) | |||
| 529 | endfor | 529 | endfor |
| 530 | if (! isempty (dup)) | 530 | if (! isempty (dup)) |
| 531 | descriptions (dup) = []; | 531 | descriptions (dup) = []; |
| 532 | endif | 532 | endif |
| 533 | endif | 533 | endif |
| 534 | endfunction | 534 | endfunction |
| 535 | 535 | ||
| @@ -555,7 +555,7 @@ function build (files, handle_deps, autoload, verbose) | |||
| 555 | endif | 555 | endif |
| 556 | files(1) = []; | 556 | files(1) = []; |
| 557 | buildlist = fullfile (builddir, "octave_packages"); | 557 | buildlist = fullfile (builddir, "octave_packages"); |
| 558 | install (files, handle_deps, autoload, installdir, installdir, verbose, | 558 | install (files, handle_deps, autoload, installdir, installdir, verbose, |
| 559 | buildlist, "", false); | 559 | buildlist, "", false); |
| 560 | unwind_protect | 560 | unwind_protect |
| 561 | repackage (builddir, buildlist); | 561 | repackage (builddir, buildlist); |
| @@ -570,7 +570,7 @@ function build (files, handle_deps, autoload, verbose) | |||
| 570 | end_unwind_protect | 570 | end_unwind_protect |
| 571 | endfunction | 571 | endfunction |
| 572 | 572 | ||
| 573 | function install (files, handle_deps, autoload, prefix, archprefix, verbose, | 573 | function install (files, handle_deps, autoload, prefix, archprefix, verbose, |
| 574 | local_list, global_list, global_install) | 574 | local_list, global_list, global_install) |
| 575 | 575 | ||
| 576 | ## Check that the directory in prefix exist. If it doesn't: create it! | 576 | ## Check that the directory in prefix exist. If it doesn't: create it! |
| @@ -583,10 +583,10 @@ function install (files, handle_deps, autoload, prefix, archprefix, verbose, | |||
| 583 | endif | 583 | endif |
| 584 | 584 | ||
| 585 | ## Get the list of installed packages. | 585 | ## Get the list of installed packages. |
| 586 | [local_packages, global_packages] = installed_packages (local_list, | 586 | [local_packages, global_packages] = installed_packages (local_list, |
| 587 | global_list); | 587 | global_list); |
| 588 | 588 | ||
| 589 | installed_pkgs_lst = {local_packages{:}, global_packages{:}}; | 589 | installed_pkgs_lst = {local_packages{:}, global_packages{:}}; |
| 590 | 590 | ||
| 591 | if (global_install) | 591 | if (global_install) |
| 592 | packages = global_packages; | 592 | packages = global_packages; |
| @@ -599,7 +599,7 @@ function install (files, handle_deps, autoload, prefix, archprefix, verbose, | |||
| 599 | try | 599 | try |
| 600 | ## Warn about non existent files. | 600 | ## Warn about non existent files. |
| 601 | for i = 1:length (files) | 601 | for i = 1:length (files) |
| 602 | if (isempty (glob(files{i}))) | 602 | if (isempty (glob(files{i}))) |
| 603 | warning ("file %s does not exist", files{i}); | 603 | warning ("file %s does not exist", files{i}); |
| 604 | endif | 604 | endif |
| 605 | endfor | 605 | endfor |
| @@ -652,32 +652,32 @@ function install (files, handle_deps, autoload, prefix, archprefix, verbose, | |||
| 652 | packdir = fullfile (pwd(), dirlist{3}); | 652 | packdir = fullfile (pwd(), dirlist{3}); |
| 653 | endif | 653 | endif |
| 654 | packdirs{end+1} = packdir; | 654 | packdirs{end+1} = packdir; |
| 655 | 655 | ||
| 656 | ## Make sure the package contains necessary files. | 656 | ## Make sure the package contains necessary files. |
| 657 | verify_directory (packdir); | 657 | verify_directory (packdir); |
| 658 | 658 | ||
| 659 | ## Read the DESCRIPTION file. | 659 | ## Read the DESCRIPTION file. |
| 660 | filename = fullfile (packdir, "DESCRIPTION"); | 660 | filename = fullfile (packdir, "DESCRIPTION"); |
| 661 | desc = get_description (filename); | 661 | desc = get_description (filename); |
| 662 | 662 | ||
| 663 | ## Verify that package name corresponds with filename. | 663 | ## Verify that package name corresponds with filename. |
| 664 | [dummy, nm] = fileparts (tgz); | 664 | [dummy, nm] = fileparts (tgz); |
| 665 | if ((length (nm) >= length (desc.name)) | 665 | if ((length (nm) >= length (desc.name)) |
| 666 | && ! strcmp (desc.name, nm(1:length(desc.name)))) | 666 | && ! strcmp (desc.name, nm(1:length(desc.name)))) |
| 667 | error ("package name '%s' doesn't correspond to its filename '%s'", | 667 | error ("package name '%s' doesn't correspond to its filename '%s'", |
| 668 | desc.name, nm); | 668 | desc.name, nm); |
| 669 | endif | 669 | endif |
| 670 | 670 | ||
| 671 | ## Set default installation directory. | 671 | ## Set default installation directory. |
| 672 | desc.dir = fullfile (prefix, cstrcat (desc.name, "-", desc.version)); | 672 | desc.dir = fullfile (prefix, cstrcat (desc.name, "-", desc.version)); |
| 673 | 673 | ||
| 674 | ## Set default architectire dependent installation directory. | 674 | ## Set default architecture dependent installation directory. |
| 675 | desc.archprefix = fullfile (archprefix, cstrcat (desc.name, "-", | 675 | desc.archprefix = fullfile (archprefix, cstrcat (desc.name, "-", |
| 676 | desc.version)); | 676 | desc.version)); |
| 677 | 677 | ||
| 678 | ## Save desc. | 678 | ## Save desc. |
| 679 | descriptions{end+1} = desc; | 679 | descriptions{end+1} = desc; |
| 680 | 680 | ||
| 681 | ## Are any of the new packages already installed? | 681 | ## Are any of the new packages already installed? |
| 682 | ## If so we'll remove the old version. | 682 | ## If so we'll remove the old version. |
| 683 | for j = 1:length (packages) | 683 | for j = 1:length (packages) |
| @@ -705,14 +705,14 @@ function install (files, handle_deps, autoload, prefix, archprefix, verbose, | |||
| 705 | if (global_install) | 705 | if (global_install) |
| 706 | ## Global installation is not allowed to have dependencies on locally | 706 | ## Global installation is not allowed to have dependencies on locally |
| 707 | ## installed packages. | 707 | ## installed packages. |
| 708 | idx1 = complement (packages_to_uninstall, | 708 | idx1 = complement (packages_to_uninstall, |
| 709 | 1:length(global_packages)); | 709 | 1:length(global_packages)); |
| 710 | pseudo_installed_packages = {global_packages{idx1}, ... | 710 | pseudo_installed_packages = {global_packages{idx1}, ... |
| 711 | descriptions{idx2}}; | 711 | descriptions{idx2}}; |
| 712 | else | 712 | else |
| 713 | idx1 = complement (packages_to_uninstall, | 713 | idx1 = complement (packages_to_uninstall, |
| 714 | 1:length(local_packages)); | 714 | 1:length(local_packages)); |
| 715 | pseudo_installed_packages = {local_packages{idx1}, ... | 715 | pseudo_installed_packages = {local_packages{idx1}, ... |
| 716 | global_packages{:}, ... | 716 | global_packages{:}, ... |
| 717 | descriptions{idx2}}; | 717 | descriptions{idx2}}; |
| 718 | endif | 718 | endif |
| @@ -755,10 +755,10 @@ function install (files, handle_deps, autoload, prefix, archprefix, verbose, | |||
| 755 | try | 755 | try |
| 756 | for i = packages_to_uninstall | 756 | for i = packages_to_uninstall |
| 757 | if (global_install) | 757 | if (global_install) |
| 758 | uninstall ({global_packages{i}.name}, false, verbose, local_list, | 758 | uninstall ({global_packages{i}.name}, false, verbose, local_list, |
| 759 | global_list, global_install); | 759 | global_list, global_install); |
| 760 | else | 760 | else |
| 761 | uninstall ({local_packages{i}.name}, false, verbose, local_list, | 761 | uninstall ({local_packages{i}.name}, false, verbose, local_list, |
| 762 | global_list, global_install); | 762 | global_list, global_install); |
| 763 | endif | 763 | endif |
| 764 | endfor | 764 | endfor |
| @@ -809,7 +809,7 @@ function install (files, handle_deps, autoload, prefix, archprefix, verbose, | |||
| 809 | ## requested that it is, then mark the package as autoloaded. | 809 | ## requested that it is, then mark the package as autoloaded. |
| 810 | for i = length (descriptions):-1:1 | 810 | for i = length (descriptions):-1:1 |
| 811 | if (autoload > 0 || (autoload == 0 && isautoload (descriptions(i)))) | 811 | if (autoload > 0 || (autoload == 0 && isautoload (descriptions(i)))) |
| 812 | fclose (fopen (fullfile (descriptions{i}.dir, "packinfo", | 812 | fclose (fopen (fullfile (descriptions{i}.dir, "packinfo", |
| 813 | ".autoload"), "wt")); | 813 | ".autoload"), "wt")); |
| 814 | descriptions{i}.autoload = 1; | 814 | descriptions{i}.autoload = 1; |
| 815 | endif | 815 | endif |
| @@ -872,10 +872,10 @@ function install (files, handle_deps, autoload, prefix, archprefix, verbose, | |||
| 872 | endif | 872 | endif |
| 873 | endfunction | 873 | endfunction |
| 874 | 874 | ||
| 875 | function uninstall (pkgnames, handle_deps, verbose, local_list, | 875 | function uninstall (pkgnames, handle_deps, verbose, local_list, |
| 876 | global_list, global_install) | 876 | global_list, global_install) |
| 877 | ## Get the list of installed packages. | 877 | ## Get the list of installed packages. |
| 878 | [local_packages, global_packages] = installed_packages(local_list, | 878 | [local_packages, global_packages] = installed_packages(local_list, |
| 879 | global_list); | 879 | global_list); |
| 880 | if (global_install) | 880 | if (global_install) |
| 881 | installed_pkgs_lst = {local_packages{:}, global_packages{:}}; | 881 | installed_pkgs_lst = {local_packages{:}, global_packages{:}}; |
| @@ -996,13 +996,13 @@ function uninstall (pkgnames, handle_deps, verbose, local_list, | |||
| 996 | 996 | ||
| 997 | endfunction | 997 | endfunction |
| 998 | 998 | ||
| 999 | function [pkg_desc_list, flag] = describe (pkgnames, verbose, | 999 | function [pkg_desc_list, flag] = describe (pkgnames, verbose, |
| 1000 | local_list, global_list) | 1000 | local_list, global_list) |
| 1001 | 1001 | ||
| 1002 | ## Get the list of installed packages. | 1002 | ## Get the list of installed packages. |
| 1003 | installed_pkgs_lst = installed_packages(local_list, global_list); | 1003 | installed_pkgs_lst = installed_packages(local_list, global_list); |
| 1004 | num_packages = length (installed_pkgs_lst); | 1004 | num_packages = length (installed_pkgs_lst); |
| 1005 | 1005 | ||
| 1006 | 1006 | ||
| 1007 | describe_all = false; | 1007 | describe_all = false; |
| 1008 | if (any (strcmp ("all", pkgnames))) | 1008 | if (any (strcmp ("all", pkgnames))) |
| @@ -1043,7 +1043,7 @@ function [pkg_desc_list, flag] = describe (pkgnames, verbose, | |||
| 1043 | non_inst_str = sprintf (" %s ", pkgnames{non_inst}); | 1043 | non_inst_str = sprintf (" %s ", pkgnames{non_inst}); |
| 1044 | error ("some packages are not installed: %s", non_inst_str); | 1044 | error ("some packages are not installed: %s", non_inst_str); |
| 1045 | else | 1045 | else |
| 1046 | pkg_desc_list{non_inst} = struct ("name", {}, "description", | 1046 | pkg_desc_list{non_inst} = struct ("name", {}, "description", |
| 1047 | {}, "provides", {}); | 1047 | {}, "provides", {}); |
| 1048 | endif | 1048 | endif |
| 1049 | endif | 1049 | endif |
| @@ -1052,7 +1052,7 @@ function [pkg_desc_list, flag] = describe (pkgnames, verbose, | |||
| 1052 | for i = 1:num_pkgnames | 1052 | for i = 1:num_pkgnames |
| 1053 | print_package_description (pkg_desc_list{i}.name, | 1053 | print_package_description (pkg_desc_list{i}.name, |
| 1054 | pkg_desc_list{i}.version, | 1054 | pkg_desc_list{i}.version, |
| 1055 | pkg_desc_list{i}.provides, | 1055 | pkg_desc_list{i}.provides, |
| 1056 | pkg_desc_list{i}.description, | 1056 | pkg_desc_list{i}.description, |
| 1057 | flag{i}, verbose); | 1057 | flag{i}, verbose); |
| 1058 | endfor | 1058 | endfor |
| @@ -1069,12 +1069,12 @@ function [pkg_idx_struct] = parse_pkg_idx (packdir) | |||
| 1069 | 1069 | ||
| 1070 | if (! exist (index_file, "file")) | 1070 | if (! exist (index_file, "file")) |
| 1071 | error ("could not find any INDEX file in directory %s, try 'pkg rebuild all' to generate missing INDEX files", packdir); | 1071 | error ("could not find any INDEX file in directory %s, try 'pkg rebuild all' to generate missing INDEX files", packdir); |
| 1072 | endif | 1072 | endif |
| 1073 | |||
| 1073 | 1074 | ||
| 1074 | |||
| 1075 | [fid, msg] = fopen (index_file, "r"); | 1075 | [fid, msg] = fopen (index_file, "r"); |
| 1076 | if (fid == -1) | 1076 | if (fid == -1) |
| 1077 | error ("the INDEX file %s could not be read: %s", | 1077 | error ("the INDEX file %s could not be read: %s", |
| 1078 | index_file, msg); | 1078 | index_file, msg); |
| 1079 | endif | 1079 | endif |
| 1080 | 1080 | ||
| @@ -1089,7 +1089,7 @@ function [pkg_idx_struct] = parse_pkg_idx (packdir) | |||
| 1089 | 1089 | ||
| 1090 | while (! feof (fid) || line != -1) | 1090 | while (! feof (fid) || line != -1) |
| 1091 | if (! any (! isspace (line)) || line(1) == "#" || any (line == "=")) | 1091 | if (! any (! isspace (line)) || line(1) == "#" || any (line == "=")) |
| 1092 | ## Comments, blank lines or comments about unimplemented | 1092 | ## Comments, blank lines or comments about unimplemented |
| 1093 | ## functions: do nothing | 1093 | ## functions: do nothing |
| 1094 | ## FIXME: probably comments and pointers to external functions | 1094 | ## FIXME: probably comments and pointers to external functions |
| 1095 | ## could be treated better when printing to screen? | 1095 | ## could be treated better when printing to screen? |
| @@ -1114,7 +1114,7 @@ function [pkg_idx_struct] = parse_pkg_idx (packdir) | |||
| 1114 | fclose (fid); | 1114 | fclose (fid); |
| 1115 | endfunction | 1115 | endfunction |
| 1116 | 1116 | ||
| 1117 | function print_package_description (pkg_name, pkg_ver, pkg_idx_struct, | 1117 | function print_package_description (pkg_name, pkg_ver, pkg_idx_struct, |
| 1118 | pkg_desc, status, verbose) | 1118 | pkg_desc, status, verbose) |
| 1119 | 1119 | ||
| 1120 | printf ("---\nPackage name:\n\t%s\n", pkg_name); | 1120 | printf ("---\nPackage name:\n\t%s\n", pkg_name); |
| @@ -1122,7 +1122,7 @@ function print_package_description (pkg_name, pkg_ver, pkg_idx_struct, | |||
| 1122 | printf ("Short description:\n\t%s\n", pkg_desc); | 1122 | printf ("Short description:\n\t%s\n", pkg_desc); |
| 1123 | printf ("Status:\n\t%s\n", status); | 1123 | printf ("Status:\n\t%s\n", status); |
| 1124 | if (verbose) | 1124 | if (verbose) |
| 1125 | printf ("---\nProvides:\n"); | 1125 | printf ("---\nProvides:\n"); |
| 1126 | for i = 1:length(pkg_idx_struct) | 1126 | for i = 1:length(pkg_idx_struct) |
| 1127 | if (! isempty (pkg_idx_struct{i}.functions)) | 1127 | if (! isempty (pkg_idx_struct{i}.functions)) |
| 1128 | printf ("%s\n", pkg_idx_struct{i}.category); | 1128 | printf ("%s\n", pkg_idx_struct{i}.category); |
| @@ -1177,26 +1177,26 @@ function repackage (builddir, buildlist) | |||
| 1177 | unlink (fullfile (pack.name, "inst", "PKG_DEL")); | 1177 | unlink (fullfile (pack.name, "inst", "PKG_DEL")); |
| 1178 | endif | 1178 | endif |
| 1179 | if (exist (fullfile (archdir, "PKG_ADD"), "file")) | 1179 | if (exist (fullfile (archdir, "PKG_ADD"), "file")) |
| 1180 | movefile (fullfile (archdir, "PKG_ADD"), | 1180 | movefile (fullfile (archdir, "PKG_ADD"), |
| 1181 | fullfile (pack.name, "PKG_ADD")); | 1181 | fullfile (pack.name, "PKG_ADD")); |
| 1182 | endif | 1182 | endif |
| 1183 | if (exist (fullfile (archdir, "PKG_DEL"), "file")) | 1183 | if (exist (fullfile (archdir, "PKG_DEL"), "file")) |
| 1184 | movefile (fullfile (archdir, "PKG_DEL"), | 1184 | movefile (fullfile (archdir, "PKG_DEL"), |
| 1185 | fullfile (pack.name, "PKG_DEL")); | 1185 | fullfile (pack.name, "PKG_DEL")); |
| 1186 | endif | 1186 | endif |
| 1187 | else | 1187 | else |
| 1188 | if (exist (fullfile (pack.name, "inst", "PKG_ADD"), "file")) | 1188 | if (exist (fullfile (pack.name, "inst", "PKG_ADD"), "file")) |
| 1189 | movefile (fullfile (pack.name, "inst", "PKG_ADD"), | 1189 | movefile (fullfile (pack.name, "inst", "PKG_ADD"), |
| 1190 | fullfile (pack.name, "PKG_ADD")); | 1190 | fullfile (pack.name, "PKG_ADD")); |
| 1191 | endif | 1191 | endif |
| 1192 | if (exist (fullfile (pack.name, "inst", "PKG_DEL"), "file")) | 1192 | if (exist (fullfile (pack.name, "inst", "PKG_DEL"), "file")) |
| 1193 | movefile (fullfile (pack.name, "inst", "PKG_DEL"), | 1193 | movefile (fullfile (pack.name, "inst", "PKG_DEL"), |
| 1194 | fullfile (pack.name, "PKG_DEL")); | 1194 | fullfile (pack.name, "PKG_DEL")); |
| 1195 | endif | 1195 | endif |
| 1196 | endif | 1196 | endif |
| 1197 | tfile = cstrcat (pack.name, "-", pack.version, ".tar"); | 1197 | tfile = cstrcat (pack.name, "-", pack.version, ".tar"); |
| 1198 | tar (tfile, pack.name); | 1198 | tar (tfile, pack.name); |
| 1199 | try | 1199 | try |
| 1200 | gzip (tfile); | 1200 | gzip (tfile); |
| 1201 | unlink (tfile); | 1201 | unlink (tfile); |
| 1202 | catch | 1202 | catch |
| @@ -1231,7 +1231,7 @@ function prepare_installation (desc, packdir) | |||
| 1231 | wd = pwd (); | 1231 | wd = pwd (); |
| 1232 | try | 1232 | try |
| 1233 | cd (packdir); | 1233 | cd (packdir); |
| 1234 | pre_install (desc); | 1234 | pre_install (desc); |
| 1235 | cd (wd); | 1235 | cd (wd); |
| 1236 | catch | 1236 | catch |
| 1237 | cd (wd); | 1237 | cd (wd); |
| @@ -1245,13 +1245,13 @@ function prepare_installation (desc, packdir) | |||
| 1245 | [status, msg] = mkdir (inst_dir); | 1245 | [status, msg] = mkdir (inst_dir); |
| 1246 | if (status != 1) | 1246 | if (status != 1) |
| 1247 | rm_rf (desc.dir); | 1247 | rm_rf (desc.dir); |
| 1248 | error ("the 'inst' directory did not exist and could not be created: %s", | 1248 | error ("the 'inst' directory did not exist and could not be created: %s", |
| 1249 | msg); | 1249 | msg); |
| 1250 | endif | 1250 | endif |
| 1251 | endif | 1251 | endif |
| 1252 | endfunction | 1252 | endfunction |
| 1253 | 1253 | ||
| 1254 | function configure_make (desc, packdir, verbose) | 1254 | function configure_make (desc, packdir, verbose) |
| 1255 | ## Perform ./configure, make, make install in "src". | 1255 | ## Perform ./configure, make, make install in "src". |
| 1256 | if (exist (fullfile (packdir, "src"), "dir")) | 1256 | if (exist (fullfile (packdir, "src"), "dir")) |
| 1257 | src = fullfile (packdir, "src"); | 1257 | src = fullfile (packdir, "src"); |
| @@ -1362,7 +1362,7 @@ function configure_make (desc, packdir, verbose) | |||
| 1362 | printf (" %s", archdependent{:}); | 1362 | printf (" %s", archdependent{:}); |
| 1363 | printf (" %s\n", archdir); | 1363 | printf (" %s\n", archdir); |
| 1364 | endif | 1364 | endif |
| 1365 | if (! exist (archdir, "dir")) | 1365 | if (! exist (archdir, "dir")) |
| 1366 | mkdir (archdir); | 1366 | mkdir (archdir); |
| 1367 | endif | 1367 | endif |
| 1368 | [status, output] = copyfile (archdependent, archdir); | 1368 | [status, output] = copyfile (archdependent, archdir); |
| @@ -1398,8 +1398,8 @@ endfunction | |||
| 1398 | function create_pkgadddel (desc, packdir, nm, global_install) | 1398 | function create_pkgadddel (desc, packdir, nm, global_install) |
| 1399 | instpkg = fullfile (desc.dir, nm); | 1399 | instpkg = fullfile (desc.dir, nm); |
| 1400 | instfid = fopen (instpkg, "wt"); | 1400 | instfid = fopen (instpkg, "wt"); |
| 1401 | ## If it is exists, most of the PKG_* file should go into the | 1401 | ## If it is exists, most of the PKG_* file should go into the |
| 1402 | ## architecture dependent directory so that the autoload/mfilename | 1402 | ## architecture dependent directory so that the autoload/mfilename |
| 1403 | ## commands work as expected. The only part that doesn't is the | 1403 | ## commands work as expected. The only part that doesn't is the |
| 1404 | ## part in the main directory. | 1404 | ## part in the main directory. |
| 1405 | archdir = fullfile (getarchprefix (desc), cstrcat (desc.name, "-", | 1405 | archdir = fullfile (getarchprefix (desc), cstrcat (desc.name, "-", |
| @@ -1465,7 +1465,7 @@ function copy_files (desc, packdir, global_install) | |||
| 1465 | if (! exist (desc.dir, "dir")) | 1465 | if (! exist (desc.dir, "dir")) |
| 1466 | [status, output] = mkdir (desc.dir); | 1466 | [status, output] = mkdir (desc.dir); |
| 1467 | if (status != 1) | 1467 | if (status != 1) |
| 1468 | error ("couldn't create installation directory %s : %s", | 1468 | error ("couldn't create installation directory %s : %s", |
| 1469 | desc.dir, output); | 1469 | desc.dir, output); |
| 1470 | endif | 1470 | endif |
| 1471 | endif | 1471 | endif |
| @@ -1493,32 +1493,32 @@ function copy_files (desc, packdir, global_install) | |||
| 1493 | [status, output] = mkdir (octm3); | 1493 | [status, output] = mkdir (octm3); |
| 1494 | if (status != 1) | 1494 | if (status != 1) |
| 1495 | rm_rf (desc.dir); | 1495 | rm_rf (desc.dir); |
| 1496 | error ("couldn't create installation directory %s : %s", | 1496 | error ("couldn't create installation directory %s : %s", |
| 1497 | octm3, output); | 1497 | octm3, output); |
| 1498 | endif | 1498 | endif |
| 1499 | endif | 1499 | endif |
| 1500 | [status, output] = mkdir (octm2); | 1500 | [status, output] = mkdir (octm2); |
| 1501 | if (status != 1) | 1501 | if (status != 1) |
| 1502 | rm_rf (desc.dir); | 1502 | rm_rf (desc.dir); |
| 1503 | error ("couldn't create installation directory %s : %s", | 1503 | error ("couldn't create installation directory %s : %s", |
| 1504 | octm2, output); | 1504 | octm2, output); |
| 1505 | endif | 1505 | endif |
| 1506 | endif | 1506 | endif |
| 1507 | [status, output] = mkdir (octm1); | 1507 | [status, output] = mkdir (octm1); |
| 1508 | if (status != 1) | 1508 | if (status != 1) |
| 1509 | rm_rf (desc.dir); | 1509 | rm_rf (desc.dir); |
| 1510 | error ("couldn't create installation directory %s : %s", | 1510 | error ("couldn't create installation directory %s : %s", |
| 1511 | octm1, output); | 1511 | octm1, output); |
| 1512 | endif | 1512 | endif |
| 1513 | endif | 1513 | endif |
| 1514 | [status, output] = mkdir (octfiledir); | 1514 | [status, output] = mkdir (octfiledir); |
| 1515 | if (status != 1) | 1515 | if (status != 1) |
| 1516 | rm_rf (desc.dir); | 1516 | rm_rf (desc.dir); |
| 1517 | error ("couldn't create installation directory %s : %s", | 1517 | error ("couldn't create installation directory %s : %s", |
| 1518 | octfiledir, output); | 1518 | octfiledir, output); |
| 1519 | endif | 1519 | endif |
| 1520 | endif | 1520 | endif |
| 1521 | [status, output] = movefile (fullfile (desc.dir, getarch (), "*"), | 1521 | [status, output] = movefile (fullfile (desc.dir, getarch (), "*"), |
| 1522 | octfiledir); | 1522 | octfiledir); |
| 1523 | rm_rf (fullfile (desc.dir, getarch ())); | 1523 | rm_rf (fullfile (desc.dir, getarch ())); |
| 1524 | 1524 | ||
| @@ -1753,7 +1753,7 @@ function deps_cell = fix_depends (depends) | |||
| 1753 | version = fix_version (parts{2}); | 1753 | version = fix_version (parts{2}); |
| 1754 | 1754 | ||
| 1755 | ## If no version is specified for the dependency | 1755 | ## If no version is specified for the dependency |
| 1756 | ## we say that the version should be greater than | 1756 | ## we say that the version should be greater than |
| 1757 | ## or equal to "0.0.0". | 1757 | ## or equal to "0.0.0". |
| 1758 | else | 1758 | else |
| 1759 | package = tolower (strip (dep)); | 1759 | package = tolower (strip (dep)); |
| @@ -1813,7 +1813,7 @@ function write_index (desc, dir, index_file, global_install) | |||
| 1813 | if (err) | 1813 | if (err) |
| 1814 | error ("couldn't read directory %s: %s", tmpdir, msg); | 1814 | error ("couldn't read directory %s: %s", tmpdir, msg); |
| 1815 | endif | 1815 | endif |
| 1816 | files = [files; files2]; | 1816 | files = [files; files2]; |
| 1817 | endif | 1817 | endif |
| 1818 | 1818 | ||
| 1819 | functions = {}; | 1819 | functions = {}; |
| @@ -1910,7 +1910,7 @@ function [out1, out2] = installed_packages (local_list, global_list) | |||
| 1910 | endfor | 1910 | endfor |
| 1911 | if (! isempty(dup)) | 1911 | if (! isempty(dup)) |
| 1912 | installed_pkgs_lst(dup) = []; | 1912 | installed_pkgs_lst(dup) = []; |
| 1913 | endif | 1913 | endif |
| 1914 | 1914 | ||
| 1915 | ## Now check if the package is loaded. | 1915 | ## Now check if the package is loaded. |
| 1916 | tmppath = strrep (path(), "\\", "/"); | 1916 | tmppath = strrep (path(), "\\", "/"); |
| @@ -1957,9 +1957,9 @@ function [out1, out2] = installed_packages (local_list, global_list) | |||
| 1957 | h1 = "Package Name"; | 1957 | h1 = "Package Name"; |
| 1958 | h2 = "Version"; | 1958 | h2 = "Version"; |
| 1959 | h3 = "Installation directory"; | 1959 | h3 = "Installation directory"; |
| 1960 | max_name_length = length (h1); | 1960 | max_name_length = length (h1); |
| 1961 | max_version_length = length (h2); | 1961 | max_version_length = length (h2); |
| 1962 | names = cell (num_packages, 1); | 1962 | names = cell (num_packages, 1); |
| 1963 | for i = 1:num_packages | 1963 | for i = 1:num_packages |
| 1964 | max_name_length = max (max_name_length, | 1964 | max_name_length = max (max_name_length, |
| 1965 | length (installed_pkgs_lst{i}.name)); | 1965 | length (installed_pkgs_lst{i}.name)); |
| @@ -1996,7 +1996,7 @@ function [out1, out2] = installed_packages (local_list, global_list) | |||
| 1996 | first_char = length (cur_dir) - max_dir_length + 4; | 1996 | first_char = length (cur_dir) - max_dir_length + 4; |
| 1997 | first_filesep = strfind (cur_dir(first_char:end), filesep()); | 1997 | first_filesep = strfind (cur_dir(first_char:end), filesep()); |
| 1998 | if (! isempty (first_filesep)) | 1998 | if (! isempty (first_filesep)) |
| 1999 | cur_dir = cstrcat ("...", | 1999 | cur_dir = cstrcat ("...", |
| 2000 | cur_dir((first_char + first_filesep(1) - 1):end)); | 2000 | cur_dir((first_char + first_filesep(1) - 1):end)); |
| 2001 | else | 2001 | else |
| 2002 | cur_dir = cstrcat ("...", cur_dir(first_char:end)); | 2002 | cur_dir = cstrcat ("...", cur_dir(first_char:end)); |
| @@ -2026,7 +2026,7 @@ function load_packages (files, handle_deps, local_list, global_list) | |||
| 2026 | if (length (files) == 1 && strcmp (files{1}, "all")) | 2026 | if (length (files) == 1 && strcmp (files{1}, "all")) |
| 2027 | idx = [1:length(installed_pkgs_lst)]; | 2027 | idx = [1:length(installed_pkgs_lst)]; |
| 2028 | ## Load auto. | 2028 | ## Load auto. |
| 2029 | elseif (length (files) == 1 && strcmp (files{1}, "auto")) | 2029 | elseif (length (files) == 1 && strcmp (files{1}, "auto")) |
| 2030 | idx = []; | 2030 | idx = []; |
| 2031 | for i = 1:length (installed_pkgs_lst) | 2031 | for i = 1:length (installed_pkgs_lst) |
| 2032 | if (exist (fullfile (pdirs{i}, "packinfo", ".autoload"), "file")) | 2032 | if (exist (fullfile (pdirs{i}, "packinfo", ".autoload"), "file")) |
| @@ -2162,7 +2162,7 @@ endfunction | |||
| 2162 | 2162 | ||
| 2163 | function archprefix = getarchprefix (desc, global_install) | 2163 | function archprefix = getarchprefix (desc, global_install) |
| 2164 | if ((nargin == 2 && global_install) || (nargin < 2 && issuperuser ())) | 2164 | if ((nargin == 2 && global_install) || (nargin < 2 && issuperuser ())) |
| 2165 | archprefix = fullfile (octave_config_info ("libexecdir"), "octave", | 2165 | archprefix = fullfile (octave_config_info ("libexecdir"), "octave", |
| 2166 | "packages", cstrcat(desc.name, "-", desc.version)); | 2166 | "packages", cstrcat(desc.name, "-", desc.version)); |
| 2167 | else | 2167 | else |
| 2168 | archprefix = desc.dir; | 2168 | archprefix = desc.dir; |
| @@ -2207,7 +2207,7 @@ function newdesc = save_order (desc) | |||
| 2207 | newdesc = {}; | 2207 | newdesc = {}; |
| 2208 | for i = 1 : length(desc) | 2208 | for i = 1 : length(desc) |
| 2209 | deps = desc{i}.depends; | 2209 | deps = desc{i}.depends; |
| 2210 | if (isempty (deps) || (length (deps) == 1 && | 2210 | if (isempty (deps) || (length (deps) == 1 && |
| 2211 | strcmp(deps{1}.package, "octave"))) | 2211 | strcmp(deps{1}.package, "octave"))) |
| 2212 | newdesc {end + 1} = desc{i}; | 2212 | newdesc {end + 1} = desc{i}; |
| 2213 | else | 2213 | else |
| @@ -2220,7 +2220,7 @@ function newdesc = save_order (desc) | |||
| 2220 | endif | 2220 | endif |
| 2221 | endfor | 2221 | endfor |
| 2222 | endfor | 2222 | endfor |
| 2223 | if (! isempty (tmpdesc)) | 2223 | if (! isempty (tmpdesc)) |
| 2224 | newdesc = {newdesc{:}, save_order(tmpdesc){:}, desc{i}}; | 2224 | newdesc = {newdesc{:}, save_order(tmpdesc){:}, desc{i}}; |
| 2225 | else | 2225 | else |
| 2226 | newdesc{end+1} = desc{i}; | 2226 | newdesc{end+1} = desc{i}; |
| @@ -2278,7 +2278,7 @@ function idx = load_package_dirs (lidx, idx, handle_deps, installed_pkgs_lst) | |||
| 2278 | else | 2278 | else |
| 2279 | if (handle_deps) | 2279 | if (handle_deps) |
| 2280 | deps = installed_pkgs_lst{i}.depends; | 2280 | deps = installed_pkgs_lst{i}.depends; |
| 2281 | if ((length (deps) > 1) || (length (deps) == 1 && | 2281 | if ((length (deps) > 1) || (length (deps) == 1 && |
| 2282 | ! strcmp(deps{1}.package, "octave"))) | 2282 | ! strcmp(deps{1}.package, "octave"))) |
| 2283 | tmplidx = []; | 2283 | tmplidx = []; |
| 2284 | for k = 1 : length (deps) | 2284 | for k = 1 : length (deps) |
| @@ -2289,7 +2289,7 @@ function idx = load_package_dirs (lidx, idx, handle_deps, installed_pkgs_lst) | |||
| 2289 | endif | 2289 | endif |
| 2290 | endfor | 2290 | endfor |
| 2291 | endfor | 2291 | endfor |
| 2292 | idx = load_package_dirs (tmplidx, idx, handle_deps, | 2292 | idx = load_package_dirs (tmplidx, idx, handle_deps, |
| 2293 | installed_pkgs_lst); | 2293 | installed_pkgs_lst); |
| 2294 | endif | 2294 | endif |
| 2295 | endif | 2295 | endif |
diff --git a/test/indent/pascal.pas b/test/indent/pascal.pas new file mode 100644 index 00000000000..07a21f23c3c --- /dev/null +++ b/test/indent/pascal.pas | |||
| @@ -0,0 +1,1088 @@ | |||
| 1 | { GPC demo program for the CRT unit. | ||
| 2 | |||
| 3 | Copyright (C) 1999-2006 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | Author: Frank Heckenbach <frank@pascal.gnu.de> | ||
| 6 | |||
| 7 | This program is free software; you can redistribute it and/or | ||
| 8 | modify it under the terms of the GNU General Public License as | ||
| 9 | published by the Free Software Foundation, version 2. | ||
| 10 | |||
| 11 | This program is distributed in the hope that it will be useful, | ||
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 14 | General Public License for more details. | ||
| 15 | |||
| 16 | You should have received a copy of the GNU General Public License | ||
| 17 | along with this program; see the file COPYING. If not, write to | ||
| 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
| 19 | Boston, MA 02111-1307, USA. | ||
| 20 | |||
| 21 | As a special exception, if you incorporate even large parts of the | ||
| 22 | code of this demo program into another program with substantially | ||
| 23 | different functionality, this does not cause the other program to | ||
| 24 | be covered by the GNU General Public License. This exception does | ||
| 25 | not however invalidate any other reasons why it might be covered | ||
| 26 | by the GNU General Public License. } | ||
| 27 | |||
| 28 | {$gnu-pascal,I+} | ||
| 29 | |||
| 30 | program CRTDemo; | ||
| 31 | |||
| 32 | uses GPC, CRT; | ||
| 33 | |||
| 34 | type | ||
| 35 | TFrameChars = array [1 .. 8] of Char; | ||
| 36 | TSimulateBlockCursorKind = (bc_None, bc_Blink, bc_Static); | ||
| 37 | |||
| 38 | const | ||
| 39 | SingleFrame: TFrameChars = (chCornerTLS, chLineHS, chCornerTRS, chLineVS, chLineVS, chCornerBLS, chLineHS, chCornerBRS); | ||
| 40 | DoubleFrame: TFrameChars = (chCornerTLD, chLineHD, chCornerTRD, chLineVD, chLineVD, chCornerBLD, chLineHD, chCornerBRD); | ||
| 41 | |||
| 42 | var | ||
| 43 | ScrollState: Boolean = True; | ||
| 44 | SimulateBlockCursorKind: TSimulateBlockCursorKind = bc_None; | ||
| 45 | CursorShape: TCursorShape = CursorNormal; | ||
| 46 | MainPanel: TPanel; | ||
| 47 | OrigScreenSize: TPoint; | ||
| 48 | |||
| 49 | procedure FrameWin (const Title: String; const Frame: TFrameChars; TitleInverse: Boolean); | ||
| 50 | var | ||
| 51 | w, h, y, Color: Integer; | ||
| 52 | Attr: TTextAttr; | ||
| 53 | begin | ||
| 54 | HideCursor; | ||
| 55 | SetPCCharSet (True); | ||
| 56 | ClrScr; | ||
| 57 | w := GetXMax; | ||
| 58 | h := GetYMax; | ||
| 59 | WriteCharAt (1, 1, 1, Frame[1], TextAttr); | ||
| 60 | WriteCharAt (2, 1, w - 2, Frame[2], TextAttr); | ||
| 61 | WriteCharAt (w, 1, 1, Frame[3], TextAttr); | ||
| 62 | for y := 2 to h - 1 do | ||
| 63 | begin | ||
| 64 | WriteCharAt (1, y, 1, Frame[4], TextAttr); | ||
| 65 | WriteCharAt (w, y, 1, Frame[5], TextAttr) | ||
| 66 | end; | ||
| 67 | WriteCharAt (1, h, 1, Frame[6], TextAttr); | ||
| 68 | WriteCharAt (2, h, w - 2, Frame[7], TextAttr); | ||
| 69 | WriteCharAt (w, h, 1, Frame[8], TextAttr); | ||
| 70 | SetPCCharSet (False); | ||
| 71 | Attr := TextAttr; | ||
| 72 | if TitleInverse then | ||
| 73 | begin | ||
| 74 | Color := GetTextColor; | ||
| 75 | TextColor (GetTextBackground); | ||
| 76 | TextBackground (Color) | ||
| 77 | end; | ||
| 78 | WriteStrAt ((w - Length (Title)) div 2 + 1, 1, Title, TextAttr); | ||
| 79 | TextAttr := Attr | ||
| 80 | end; | ||
| 81 | |||
| 82 | function GetKey (TimeOut: Integer) = Key: TKey; forward; | ||
| 83 | |||
| 84 | procedure ClosePopUpWindow; | ||
| 85 | begin | ||
| 86 | PanelDelete (GetActivePanel); | ||
| 87 | PanelDelete (GetActivePanel) | ||
| 88 | end; | ||
| 89 | |||
| 90 | function PopUpConfirm (XSize, YSize: Integer; const Msg: String): Boolean; | ||
| 91 | var | ||
| 92 | ax, ay: Integer; | ||
| 93 | Key: TKey; | ||
| 94 | SSize: TPoint; | ||
| 95 | begin | ||
| 96 | repeat | ||
| 97 | SSize := ScreenSize; | ||
| 98 | ax := (SSize.x - XSize - 4) div 2 + 1; | ||
| 99 | ay := (SSize.y - YSize - 4) div 2 + 1; | ||
| 100 | PanelNew (ax, ay, ax + XSize + 3, ay + YSize + 1, False); | ||
| 101 | TextBackground (Black); | ||
| 102 | TextColor (Yellow); | ||
| 103 | SetControlChars (True); | ||
| 104 | FrameWin ('', DoubleFrame, False); | ||
| 105 | NormalCursor; | ||
| 106 | PanelNew (ax + 2, ay + 1, ax + XSize + 2, ay + YSize, False); | ||
| 107 | ClrScr; | ||
| 108 | Write (Msg); | ||
| 109 | Key := GetKey (-1); | ||
| 110 | if Key = kbScreenSizeChanged then ClosePopUpWindow | ||
| 111 | until Key <> kbScreenSizeChanged; | ||
| 112 | PopUpConfirm := not (Key in [kbEsc, kbAltEsc]) | ||
| 113 | end; | ||
| 114 | |||
| 115 | procedure MainDraw; | ||
| 116 | begin | ||
| 117 | WriteLn ('3, F3 : Open a window'); | ||
| 118 | WriteLn ('4, F4 : Close window'); | ||
| 119 | WriteLn ('5, F5 : Previous window'); | ||
| 120 | WriteLn ('6, F6 : Next window'); | ||
| 121 | WriteLn ('7, F7 : Move window'); | ||
| 122 | WriteLn ('8, F8 : Resize window'); | ||
| 123 | Write ('q, Esc: Quit') | ||
| 124 | end; | ||
| 125 | |||
| 126 | procedure StatusDraw; | ||
| 127 | const | ||
| 128 | YesNo: array [Boolean] of String [3] = ('No', 'Yes'); | ||
| 129 | SimulateBlockCursorIDs: array [TSimulateBlockCursorKind] of String [8] = ('Off', 'Blinking', 'Static'); | ||
| 130 | CursorShapeIDs: array [TCursorShape] of String [7] = ('Ignored', 'Hidden', 'Normal', 'Fat', 'Block'); | ||
| 131 | var | ||
| 132 | SSize: TPoint; | ||
| 133 | begin | ||
| 134 | WriteLn ('You can change some of the following'); | ||
| 135 | WriteLn ('settings by pressing the key shown'); | ||
| 136 | WriteLn ('in parentheses. Naturally, color and'); | ||
| 137 | WriteLn ('changing the cursor shape or screen'); | ||
| 138 | WriteLn ('size does not work on all terminals.'); | ||
| 139 | WriteLn; | ||
| 140 | WriteLn ('XCurses version: ', YesNo[XCRT]); | ||
| 141 | WriteLn ('CRTSavePreviousScreen: ', YesNo[CRTSavePreviousScreenWorks]); | ||
| 142 | WriteLn ('(M)onochrome: ', YesNo[IsMonochrome]); | ||
| 143 | SSize := ScreenSize; | ||
| 144 | WriteLn ('Screen (C)olumns: ', SSize.x); | ||
| 145 | WriteLn ('Screen (L)ines: ', SSize.y); | ||
| 146 | WriteLn ('(R)estore screen size'); | ||
| 147 | WriteLn ('(B)reak checking: ', YesNo[CheckBreak]); | ||
| 148 | WriteLn ('(S)crolling: ', YesNo[ScrollState]); | ||
| 149 | WriteLn ('S(i)mulated block cursor: ', SimulateBlockCursorIDs[SimulateBlockCursorKind]); | ||
| 150 | Write ('C(u)rsor shape: ', CursorShapeIDs[CursorShape]); | ||
| 151 | GotoXY (36, WhereY) | ||
| 152 | end; | ||
| 153 | |||
| 154 | procedure RedrawAll; forward; | ||
| 155 | procedure CheckScreenSize; forward; | ||
| 156 | |||
| 157 | procedure StatusKey (Key: TKey); | ||
| 158 | var SSize, NewSize: TPoint; | ||
| 159 | begin | ||
| 160 | case LoCase (Key2Char (Key)) of | ||
| 161 | 'm': begin | ||
| 162 | SetMonochrome (not IsMonochrome); | ||
| 163 | RedrawAll | ||
| 164 | end; | ||
| 165 | 'c': begin | ||
| 166 | SSize := ScreenSize; | ||
| 167 | if SSize.x > 40 then | ||
| 168 | NewSize.x := 40 | ||
| 169 | else | ||
| 170 | NewSize.x := 80; | ||
| 171 | if SSize.y > 25 then | ||
| 172 | NewSize.y := 50 | ||
| 173 | else | ||
| 174 | NewSize.y := 25; | ||
| 175 | SetScreenSize (NewSize.x, NewSize.y); | ||
| 176 | CheckScreenSize | ||
| 177 | end; | ||
| 178 | 'l': begin | ||
| 179 | SSize := ScreenSize; | ||
| 180 | if SSize.x > 40 then | ||
| 181 | NewSize.x := 80 | ||
| 182 | else | ||
| 183 | NewSize.x := 40; | ||
| 184 | if SSize.y > 25 then | ||
| 185 | NewSize.y := 25 | ||
| 186 | else | ||
| 187 | NewSize.y := 50; | ||
| 188 | SetScreenSize (NewSize.x, NewSize.y); | ||
| 189 | CheckScreenSize | ||
| 190 | end; | ||
| 191 | 'r': begin | ||
| 192 | SetScreenSize (OrigScreenSize.x, OrigScreenSize.y); | ||
| 193 | CheckScreenSize | ||
| 194 | end; | ||
| 195 | 'b': CheckBreak := not CheckBreak; | ||
| 196 | 's': ScrollState := not ScrollState; | ||
| 197 | 'i': if SimulateBlockCursorKind = High (SimulateBlockCursorKind) then | ||
| 198 | SimulateBlockCursorKind := Low (SimulateBlockCursorKind) | ||
| 199 | else | ||
| 200 | Inc (SimulateBlockCursorKind); | ||
| 201 | 'u': case CursorShape of | ||
| 202 | CursorNormal: CursorShape := CursorBlock; | ||
| 203 | CursorFat, | ||
| 204 | CursorBlock : CursorShape := CursorHidden; | ||
| 205 | else CursorShape := CursorNormal | ||
| 206 | end; | ||
| 207 | end; | ||
| 208 | ClrScr; | ||
| 209 | StatusDraw | ||
| 210 | end; | ||
| 211 | |||
| 212 | procedure TextAttrDemo; | ||
| 213 | var f, b, y, x1, y1, x2, y2, Fill, n1, n2, n3: Integer; | ||
| 214 | begin | ||
| 215 | GetWindow (x1, y1, x2, y2); | ||
| 216 | Window (x1 - 1, y1, x2, y2); | ||
| 217 | TextColor (White); | ||
| 218 | TextBackground (Blue); | ||
| 219 | ClrScr; | ||
| 220 | SetScroll (False); | ||
| 221 | Fill := GetXMax - 32; | ||
| 222 | for y := 1 to GetYMax do | ||
| 223 | begin | ||
| 224 | GotoXY (1, y); | ||
| 225 | b := (y - 1) mod 16; | ||
| 226 | n1 := 0; | ||
| 227 | for f := 0 to 15 do | ||
| 228 | begin | ||
| 229 | TextAttr := f + 16 * b; | ||
| 230 | n2 := (Fill * (1 + 2 * f) + 16) div 32; | ||
| 231 | n3 := (Fill * (2 + 2 * f) + 16) div 32; | ||
| 232 | Write ('' : n2 - n1, NumericBaseDigitsUpper[b], NumericBaseDigitsUpper[f], '' : n3 - n2); | ||
| 233 | n1 := n3 | ||
| 234 | end | ||
| 235 | end | ||
| 236 | end; | ||
| 237 | |||
| 238 | procedure CharSetDemo (UsePCCharSet: Boolean); | ||
| 239 | var h, l, y, x1, y1, x2, y2, Fill, n1, n2: Integer; | ||
| 240 | begin | ||
| 241 | GetWindow (x1, y1, x2, y2); | ||
| 242 | Window (x1 - 1, y1, x2, y2); | ||
| 243 | ClrScr; | ||
| 244 | SetScroll (False); | ||
| 245 | SetPCCharSet (UsePCCharSet); | ||
| 246 | SetControlChars (False); | ||
| 247 | Fill := GetXMax - 35; | ||
| 248 | for y := 1 to GetYMax do | ||
| 249 | begin | ||
| 250 | GotoXY (1, y); | ||
| 251 | h := (y - 2) mod 16; | ||
| 252 | n1 := (Fill + 9) div 18; | ||
| 253 | if y = 1 then | ||
| 254 | Write ('' : 3 + n1) | ||
| 255 | else | ||
| 256 | Write (16 * h : 3 + n1); | ||
| 257 | for l := 0 to 15 do | ||
| 258 | begin | ||
| 259 | n2 := (Fill * (2 + l) + 9) div 18; | ||
| 260 | if y = 1 then | ||
| 261 | Write ('' : n2 - n1, l : 2) | ||
| 262 | else | ||
| 263 | Write ('' : n2 - n1 + 1, Chr (16 * h + l)); | ||
| 264 | n1 := n2 | ||
| 265 | end | ||
| 266 | end | ||
| 267 | end; | ||
| 268 | |||
| 269 | procedure NormalCharSetDemo; | ||
| 270 | begin | ||
| 271 | CharSetDemo (False) | ||
| 272 | end; | ||
| 273 | |||
| 274 | procedure PCCharSetDemo; | ||
| 275 | begin | ||
| 276 | CharSetDemo (True) | ||
| 277 | end; | ||
| 278 | |||
| 279 | procedure FKeyDemoDraw; | ||
| 280 | var x1, y1, x2, y2: Integer; | ||
| 281 | begin | ||
| 282 | GetWindow (x1, y1, x2, y2); | ||
| 283 | Window (x1, y1, x2 - 1, y2); | ||
| 284 | ClrScr; | ||
| 285 | SetScroll (False); | ||
| 286 | WriteLn ('You can type the following keys'); | ||
| 287 | WriteLn ('(function keys if present on the'); | ||
| 288 | WriteLn ('terminal, letters as alternatives):'); | ||
| 289 | GotoXY (1, 4); | ||
| 290 | WriteLn ('S, Left : left (wrap-around)'); | ||
| 291 | WriteLn ('D, Right : right (wrap-around)'); | ||
| 292 | WriteLn ('E, Up : up (wrap-around)'); | ||
| 293 | WriteLn ('X, Down : down (wrap-around)'); | ||
| 294 | WriteLn ('A, Home : go to first column'); | ||
| 295 | WriteLn ('F, End : go to last column'); | ||
| 296 | WriteLn ('R, Page Up : go to first line'); | ||
| 297 | WriteLn ('C, Page Down: go to last line'); | ||
| 298 | WriteLn ('Y, Ctrl-PgUp: first column and line'); | ||
| 299 | GotoXY (1, 13); | ||
| 300 | WriteLn ('B, Ctrl-PgDn: last column and line'); | ||
| 301 | WriteLn ('Z, Ctrl-Home: clear screen'); | ||
| 302 | WriteLn ('N, Ctrl-End : clear to end of line'); | ||
| 303 | WriteLn ('V, Insert : insert a line'); | ||
| 304 | WriteLn ('T, Delete : delete a line'); | ||
| 305 | WriteLn ('# : beep'); | ||
| 306 | WriteLn ('* : flash'); | ||
| 307 | WriteLn ('Tab, Enter, Backspace, other'); | ||
| 308 | WriteLn (' normal characters: write text') | ||
| 309 | end; | ||
| 310 | |||
| 311 | procedure FKeyDemoKey (Key: TKey); | ||
| 312 | const TabSize = 8; | ||
| 313 | var | ||
| 314 | ch: Char; | ||
| 315 | NewX: Integer; | ||
| 316 | begin | ||
| 317 | case LoCaseKey (Key) of | ||
| 318 | Ord ('s'), kbLeft : if WhereX = 1 then GotoXY (GetXMax, WhereY) else GotoXY (WhereX - 1, WhereY); | ||
| 319 | Ord ('d'), kbRight : if WhereX = GetXMax then GotoXY (1, WhereY) else GotoXY (WhereX + 1, WhereY); | ||
| 320 | Ord ('e'), kbUp : if WhereY = 1 then GotoXY (WhereX, GetYMax) else GotoXY (WhereX, WhereY - 1); | ||
| 321 | Ord ('x'), kbDown : if WhereY = GetYMax then GotoXY (WhereX, 1) else GotoXY (WhereX, WhereY + 1); | ||
| 322 | Ord ('a'), kbHome : Write (chCR); | ||
| 323 | Ord ('f'), kbEnd : GotoXY (GetXMax, WhereY); | ||
| 324 | Ord ('r'), kbPgUp : GotoXY (WhereX, 1); | ||
| 325 | Ord ('c'), kbPgDn : GotoXY (WhereX, GetYMax); | ||
| 326 | Ord ('y'), kbCtrlPgUp: GotoXY (1, 1); | ||
| 327 | Ord ('b'), kbCtrlPgDn: GotoXY (GetXMax, GetYMax); | ||
| 328 | Ord ('z'), kbCtrlHome: ClrScr; | ||
| 329 | Ord ('n'), kbCtrlEnd : ClrEOL; | ||
| 330 | Ord ('v'), kbIns : InsLine; | ||
| 331 | Ord ('t'), kbDel : DelLine; | ||
| 332 | Ord ('#') : Beep; | ||
| 333 | Ord ('*') : Flash; | ||
| 334 | kbTab : begin | ||
| 335 | NewX := ((WhereX - 1) div TabSize + 1) * TabSize + 1; | ||
| 336 | if NewX <= GetXMax then GotoXY (NewX, WhereY) else WriteLn | ||
| 337 | end; | ||
| 338 | kbCR : WriteLn; | ||
| 339 | kbBkSp : Write (chBkSp, ' ', chBkSp); | ||
| 340 | else ch := Key2Char (Key); | ||
| 341 | if ch <> #0 then Write (ch) | ||
| 342 | end | ||
| 343 | end; | ||
| 344 | |||
| 345 | procedure KeyDemoDraw; | ||
| 346 | begin | ||
| 347 | WriteLn ('Press some keys ...') | ||
| 348 | end; | ||
| 349 | |||
| 350 | procedure KeyDemoKey (Key: TKey); | ||
| 351 | var ch: Char; | ||
| 352 | begin | ||
| 353 | ch := Key2Char (Key); | ||
| 354 | if ch <> #0 then | ||
| 355 | begin | ||
| 356 | Write ('Normal key'); | ||
| 357 | if IsPrintable (ch) then Write (' `', ch, ''''); | ||
| 358 | WriteLn (', ASCII #', Ord (ch)) | ||
| 359 | end | ||
| 360 | else | ||
| 361 | WriteLn ('Special key ', Ord (Key2Scan (Key))) | ||
| 362 | end; | ||
| 363 | |||
| 364 | procedure IOSelectPeriodical; | ||
| 365 | var | ||
| 366 | CurrentTime: TimeStamp; | ||
| 367 | s: String (8); | ||
| 368 | i: Integer; | ||
| 369 | begin | ||
| 370 | GetTimeStamp (CurrentTime); | ||
| 371 | with CurrentTime do | ||
| 372 | WriteStr (s, Hour : 2, ':', Minute : 2, ':', Second : 2); | ||
| 373 | for i := 1 to Length (s) do | ||
| 374 | if s[i] = ' ' then s[i] := '0'; | ||
| 375 | GotoXY (1, 12); | ||
| 376 | Write ('The time is: ', s) | ||
| 377 | end; | ||
| 378 | |||
| 379 | procedure IOSelectDraw; | ||
| 380 | begin | ||
| 381 | WriteLn ('IOSelect is a way to handle I/O from'); | ||
| 382 | WriteLn ('or to several places simultaneously,'); | ||
| 383 | WriteLn ('without having to use threads or'); | ||
| 384 | WriteLn ('signal/interrupt handlers or waste'); | ||
| 385 | WriteLn ('CPU time with busy waiting.'); | ||
| 386 | WriteLn; | ||
| 387 | WriteLn ('This demo shows how IOSelect works'); | ||
| 388 | WriteLn ('in connection with CRT. It displays'); | ||
| 389 | WriteLn ('a clock, but still reacts to user'); | ||
| 390 | WriteLn ('input immediately.'); | ||
| 391 | IOSelectPeriodical | ||
| 392 | end; | ||
| 393 | |||
| 394 | procedure ModifierPeriodical; | ||
| 395 | const | ||
| 396 | Pressed: array [Boolean] of String [8] = ('Released', 'Pressed'); | ||
| 397 | ModifierNames: array [1 .. 7] of record | ||
| 398 | Modifier: Integer; | ||
| 399 | Name: String (17) | ||
| 400 | end = | ||
| 401 | ((shLeftShift, 'Left Shift'), | ||
| 402 | (shRightShift, 'Right Shift'), | ||
| 403 | (shLeftCtrl, 'Left Control'), | ||
| 404 | (shRightCtrl, 'Right Control'), | ||
| 405 | (shAlt, 'Alt (left)'), | ||
| 406 | (shAltGr, 'AltGr (right Alt)'), | ||
| 407 | (shExtra, 'Extra')); | ||
| 408 | var | ||
| 409 | ShiftState, i: Integer; | ||
| 410 | begin | ||
| 411 | ShiftState := GetShiftState; | ||
| 412 | for i := 1 to 7 do | ||
| 413 | with ModifierNames[i] do | ||
| 414 | begin | ||
| 415 | GotoXY (1, 4 + i); | ||
| 416 | ClrEOL; | ||
| 417 | Write (Name, ':'); | ||
| 418 | GotoXY (20, WhereY); | ||
| 419 | Write (Pressed[(ShiftState and Modifier) <> 0]) | ||
| 420 | end | ||
| 421 | end; | ||
| 422 | |||
| 423 | procedure ModifierDraw; | ||
| 424 | begin | ||
| 425 | WriteLn ('Modifier keys (NOTE: only'); | ||
| 426 | WriteLn ('available on some systems;'); | ||
| 427 | WriteLn ('X11: only after key press):'); | ||
| 428 | ModifierPeriodical | ||
| 429 | end; | ||
| 430 | |||
| 431 | procedure ChecksDraw; | ||
| 432 | begin | ||
| 433 | WriteLn ('(O)S shell'); | ||
| 434 | WriteLn ('OS shell with (C)learing'); | ||
| 435 | WriteLn ('(R)efresh check'); | ||
| 436 | Write ('(S)ound check') | ||
| 437 | end; | ||
| 438 | |||
| 439 | procedure ChecksKey (Key: TKey); | ||
| 440 | var | ||
| 441 | i, j: Integer; | ||
| 442 | WasteTime: Real; attribute (volatile); | ||
| 443 | |||
| 444 | procedure DoOSShell; | ||
| 445 | var | ||
| 446 | Result: Integer; | ||
| 447 | Shell: TString; | ||
| 448 | begin | ||
| 449 | Shell := GetShellPath (Null); | ||
| 450 | {$I-} | ||
| 451 | Result := Execute (Shell); | ||
| 452 | {$I+} | ||
| 453 | if (InOutRes <> 0) or (Result <> 0) then | ||
| 454 | begin | ||
| 455 | ClrScr; | ||
| 456 | if InOutRes <> 0 then | ||
| 457 | WriteLn (GetIOErrorMessage, ' while trying to execute `', Shell, '''.') | ||
| 458 | else | ||
| 459 | WriteLn ('`', Shell, ''' returned status ', Result, '.'); | ||
| 460 | Write ('Any key to continue.'); | ||
| 461 | BlockCursor; | ||
| 462 | Discard (GetKey (-1)) | ||
| 463 | end | ||
| 464 | end; | ||
| 465 | |||
| 466 | begin | ||
| 467 | case LoCase (Key2Char (Key)) of | ||
| 468 | 'o': begin | ||
| 469 | if PopUpConfirm (36, 12, 'You will now get an OS shell. Unless' + NewLine + | ||
| 470 | 'CRTDemo is running in its own (GUI)' + NewLine + | ||
| 471 | 'window, the shell will run on the' + NewLine + | ||
| 472 | 'same screen as CRTDemo which is not' + NewLine + | ||
| 473 | 'cleared before the shell is started.' + NewLine + | ||
| 474 | 'If possible, the screen contents are' + NewLine + | ||
| 475 | 'restored to the state before CRTDemo' + NewLine + | ||
| 476 | 'was started. After leaving the shell' + NewLine + | ||
| 477 | 'in the usual way (usually by enter-' + NewLine + | ||
| 478 | 'ing `exit''), you will get back to' + NewLine + | ||
| 479 | 'the demo. <ESC> to abort, any other' + NewLine + | ||
| 480 | 'key to start.') then | ||
| 481 | begin | ||
| 482 | RestoreTerminal (True); | ||
| 483 | DoOSShell | ||
| 484 | end; | ||
| 485 | ClosePopUpWindow | ||
| 486 | end; | ||
| 487 | 'c': begin | ||
| 488 | if PopUpConfirm (36, 9, 'You will now get an OS shell. Unless' + NewLine + | ||
| 489 | 'CRTDemo is running in its own (GUI)' + NewLine + | ||
| 490 | 'window, the screen will be cleared,' + NewLine + | ||
| 491 | 'and the cursor will be moved to the' + NewLine + | ||
| 492 | 'top before the shell is started.' + NewLine + | ||
| 493 | 'After leaving the shell in the usual' + NewLine + | ||
| 494 | 'way (usually by entering `exit''),' + NewLine + | ||
| 495 | 'you will get back to the demo. <ESC>' + NewLine + | ||
| 496 | 'to abort, any other key to start.') then | ||
| 497 | begin | ||
| 498 | RestoreTerminalClearCRT; | ||
| 499 | DoOSShell | ||
| 500 | end; | ||
| 501 | ClosePopUpWindow | ||
| 502 | end; | ||
| 503 | 'r': begin | ||
| 504 | if PopUpConfirm (36, 11, 'The program will now get busy with' + NewLine + | ||
| 505 | 'some dummy computations. However,' + NewLine + | ||
| 506 | 'CRT output in the form of dots will' + NewLine + | ||
| 507 | 'still appear continuously one by one' + NewLine + | ||
| 508 | '(rather than the whole line at once' + NewLine + | ||
| 509 | 'in the end). While running, the test' + NewLine + | ||
| 510 | 'cannot be interrupted. <ESC> to' + NewLine + | ||
| 511 | 'abort, any other key to start.') then | ||
| 512 | begin | ||
| 513 | SetCRTUpdate (UpdateRegularly); | ||
| 514 | BlockCursor; | ||
| 515 | WriteLn; | ||
| 516 | WriteLn; | ||
| 517 | for i := 1 to GetXMax - 2 do | ||
| 518 | begin | ||
| 519 | Write ('.'); | ||
| 520 | for j := 1 to 400000 do WasteTime := Random | ||
| 521 | end; | ||
| 522 | SetCRTUpdate (UpdateInput); | ||
| 523 | WriteLn; | ||
| 524 | Write ('Press any key.'); | ||
| 525 | Discard (GetKey (-1)) | ||
| 526 | end; | ||
| 527 | ClosePopUpWindow | ||
| 528 | end; | ||
| 529 | 's': begin | ||
| 530 | if PopUpConfirm (32, 4, 'You will now hear some sounds if' + NewLine + | ||
| 531 | 'supported (otherwise there will' + NewLine + | ||
| 532 | 'just be a short pause). <ESC> to' + NewLine + | ||
| 533 | 'abort, any other key to start.') then | ||
| 534 | begin | ||
| 535 | BlockCursor; | ||
| 536 | for i := 0 to 7 do | ||
| 537 | begin | ||
| 538 | Sound (Round (440 * 2 ** (Round (i * 12 / 7 + 0.3) / 12))); | ||
| 539 | if GetKey (400000) in [kbEsc, kbAltEsc] then Break | ||
| 540 | end; | ||
| 541 | NoSound | ||
| 542 | end; | ||
| 543 | ClosePopUpWindow | ||
| 544 | end; | ||
| 545 | end | ||
| 546 | end; | ||
| 547 | |||
| 548 | type | ||
| 549 | PWindowList = ^TWindowList; | ||
| 550 | TWindowList = record | ||
| 551 | Next, Prev: PWindowList; | ||
| 552 | Panel, FramePanel: TPanel; | ||
| 553 | WindowType: Integer; | ||
| 554 | x1, y1, xs, ys: Integer; | ||
| 555 | State: (ws_None, ws_Moving, ws_Resizing); | ||
| 556 | end; | ||
| 557 | |||
| 558 | TKeyProc = procedure (Key: TKey); | ||
| 559 | TProcedure = procedure; | ||
| 560 | |||
| 561 | const | ||
| 562 | MenuNameLength = 16; | ||
| 563 | WindowTypes: array [0 .. 9] of record | ||
| 564 | DrawProc, | ||
| 565 | PeriodicalProc: procedure; | ||
| 566 | KeyProc : TKeyProc; | ||
| 567 | Name : String (MenuNameLength); | ||
| 568 | Color, | ||
| 569 | Background, | ||
| 570 | MinSizeX, | ||
| 571 | MinSizeY, | ||
| 572 | PrefSizeX, | ||
| 573 | PrefSizeY : Integer; | ||
| 574 | RedrawAlways, | ||
| 575 | WantCursor : Boolean | ||
| 576 | end = | ||
| 577 | ((MainDraw , nil , nil , 'CRT Demo' , LightGreen, Blue , 26, 7, 0, 0, False, False), | ||
| 578 | (StatusDraw , nil , StatusKey , 'Status' , White , Red , 38, 16, 0, 0, True, True), | ||
| 579 | (TextAttrDemo , nil , nil , 'Text Attributes' , White , Blue , 32, 16, 64, 16, False, False), | ||
| 580 | (NormalCharSetDemo, nil , nil , 'Character Set' , Black , Green , 35, 17, 53, 17, False, False), | ||
| 581 | (PCCharSetDemo , nil , nil , 'PC Character Set', Black , Brown , 35, 17, 53, 17, False, False), | ||
| 582 | (KeyDemoDraw , nil , KeyDemoKey , 'Keys' , Blue , LightGray, 29, 5, -1, -1, False, True), | ||
| 583 | (FKeyDemoDraw , nil , FKeyDemoKey, 'Function Keys' , Blue , LightGray, 37, 22, -1, -1, False, True), | ||
| 584 | (ModifierDraw , ModifierPeriodical, nil , 'Modifier Keys' , Black , Cyan , 29, 11, 0, 0, True, False), | ||
| 585 | (IOSelectDraw , IOSelectPeriodical, nil , 'IOSelect Demo' , White , Magenta , 38, 12, 0, 0, False, False), | ||
| 586 | (ChecksDraw , nil , ChecksKey , 'Various Checks' , Black , Red , 26, 4, 0, 0, False, False)); | ||
| 587 | |||
| 588 | MenuMax = High (WindowTypes); | ||
| 589 | MenuXSize = MenuNameLength + 4; | ||
| 590 | MenuYSize = MenuMax + 2; | ||
| 591 | |||
| 592 | var | ||
| 593 | WindowList: PWindowList = nil; | ||
| 594 | |||
| 595 | procedure RedrawFrame (p: PWindowList); | ||
| 596 | begin | ||
| 597 | with p^, WindowTypes[WindowType] do | ||
| 598 | begin | ||
| 599 | PanelActivate (FramePanel); | ||
| 600 | Window (x1, y1, x1 + xs - 1, y1 + ys - 1); | ||
| 601 | ClrScr; | ||
| 602 | case State of | ||
| 603 | ws_None : if p = WindowList then | ||
| 604 | FrameWin (' ' + Name + ' ', DoubleFrame, True) | ||
| 605 | else | ||
| 606 | FrameWin (' ' + Name + ' ', SingleFrame, False); | ||
| 607 | ws_Moving : FrameWin (' Move Window ', SingleFrame, True); | ||
| 608 | ws_Resizing: FrameWin (' Resize Window ', SingleFrame, True); | ||
| 609 | end | ||
| 610 | end | ||
| 611 | end; | ||
| 612 | |||
| 613 | procedure DrawWindow (p: PWindowList); | ||
| 614 | begin | ||
| 615 | with p^, WindowTypes[WindowType] do | ||
| 616 | begin | ||
| 617 | RedrawFrame (p); | ||
| 618 | PanelActivate (Panel); | ||
| 619 | Window (x1 + 2, y1 + 1, x1 + xs - 2, y1 + ys - 2); | ||
| 620 | ClrScr; | ||
| 621 | DrawProc | ||
| 622 | end | ||
| 623 | end; | ||
| 624 | |||
| 625 | procedure RedrawAll; | ||
| 626 | var | ||
| 627 | LastPanel: TPanel; | ||
| 628 | p: PWindowList; | ||
| 629 | x2, y2: Integer; | ||
| 630 | begin | ||
| 631 | LastPanel := GetActivePanel; | ||
| 632 | PanelActivate (MainPanel); | ||
| 633 | TextBackground (Blue); | ||
| 634 | ClrScr; | ||
| 635 | p := WindowList; | ||
| 636 | if p <> nil then | ||
| 637 | repeat | ||
| 638 | with p^ do | ||
| 639 | begin | ||
| 640 | PanelActivate (FramePanel); | ||
| 641 | GetWindow (x1, y1, x2, y2); { updated automatically by CRT } | ||
| 642 | xs := x2 - x1 + 1; | ||
| 643 | ys := y2 - y1 + 1 | ||
| 644 | end; | ||
| 645 | DrawWindow (p); | ||
| 646 | p := p^.Next | ||
| 647 | until p = WindowList; | ||
| 648 | PanelActivate (LastPanel) | ||
| 649 | end; | ||
| 650 | |||
| 651 | procedure CheckScreenSize; | ||
| 652 | var | ||
| 653 | LastPanel: TPanel; | ||
| 654 | MinScreenSizeX, MinScreenSizeY, i: Integer; | ||
| 655 | SSize: TPoint; | ||
| 656 | begin | ||
| 657 | LastPanel := GetActivePanel; | ||
| 658 | PanelActivate (MainPanel); | ||
| 659 | HideCursor; | ||
| 660 | MinScreenSizeX := MenuXSize; | ||
| 661 | MinScreenSizeY := MenuYSize; | ||
| 662 | for i := Low (WindowTypes) to High (WindowTypes) do | ||
| 663 | with WindowTypes[i] do | ||
| 664 | begin | ||
| 665 | MinScreenSizeX := Max (MinScreenSizeX, MinSizeX + 2); | ||
| 666 | MinScreenSizeY := Max (MinScreenSizeY, MinSizeY + 2) | ||
| 667 | end; | ||
| 668 | SSize := ScreenSize; | ||
| 669 | Window (1, 1, SSize.x, SSize.y); | ||
| 670 | if (SSize.x < MinScreenSizeX) or (SSize.y < MinScreenSizeY) then | ||
| 671 | begin | ||
| 672 | NormVideo; | ||
| 673 | ClrScr; | ||
| 674 | RestoreTerminal (True); | ||
| 675 | WriteLn (StdErr, 'Sorry, your screen is too small for this demo (', SSize.x, 'x', SSize.y, ').'); | ||
| 676 | WriteLn (StdErr, 'You need at least ', MinScreenSizeX, 'x', MinScreenSizeY, ' characters.'); | ||
| 677 | Halt (2) | ||
| 678 | end; | ||
| 679 | PanelActivate (LastPanel); | ||
| 680 | RedrawAll | ||
| 681 | end; | ||
| 682 | |||
| 683 | procedure Die; attribute (noreturn); | ||
| 684 | begin | ||
| 685 | NoSound; | ||
| 686 | RestoreTerminalClearCRT; | ||
| 687 | WriteLn (StdErr, 'You''re trying to kill me. Since I have break checking turned off,'); | ||
| 688 | WriteLn (StdErr, 'I''m not dying, but I''ll do you a favour and terminate now.'); | ||
| 689 | Halt (3) | ||
| 690 | end; | ||
| 691 | |||
| 692 | function GetKey (TimeOut: Integer) = Key: TKey; | ||
| 693 | var | ||
| 694 | NeedSelect, SelectValue: Integer; | ||
| 695 | SimulateBlockCursorCurrent: TSimulateBlockCursorKind; | ||
| 696 | SelectInput: array [1 .. 1] of PAnyFile = (@Input); | ||
| 697 | NextSelectTime: MicroSecondTimeType = 0; attribute (static); | ||
| 698 | TimeOutTime: MicroSecondTimeType; | ||
| 699 | LastPanel: TPanel; | ||
| 700 | p: PWindowList; | ||
| 701 | begin | ||
| 702 | LastPanel := GetActivePanel; | ||
| 703 | if TimeOut < 0 then | ||
| 704 | TimeOutTime := High (TimeOutTime) | ||
| 705 | else | ||
| 706 | TimeOutTime := GetMicroSecondTime + TimeOut; | ||
| 707 | NeedSelect := 0; | ||
| 708 | if TimeOut >= 0 then | ||
| 709 | Inc (NeedSelect); | ||
| 710 | SimulateBlockCursorCurrent := SimulateBlockCursorKind; | ||
| 711 | if SimulateBlockCursorCurrent <> bc_None then | ||
| 712 | Inc (NeedSelect); | ||
| 713 | p := WindowList; | ||
| 714 | repeat | ||
| 715 | if @WindowTypes[p^.WindowType].PeriodicalProc <> nil then | ||
| 716 | Inc (NeedSelect); | ||
| 717 | p := p^.Next | ||
| 718 | until p = WindowList; | ||
| 719 | p := WindowList; | ||
| 720 | repeat | ||
| 721 | with p^, WindowTypes[WindowType] do | ||
| 722 | if RedrawAlways then | ||
| 723 | begin | ||
| 724 | PanelActivate (Panel); | ||
| 725 | ClrScr; | ||
| 726 | DrawProc | ||
| 727 | end; | ||
| 728 | p := p^.Next | ||
| 729 | until p = WindowList; | ||
| 730 | if NeedSelect <> 0 then | ||
| 731 | repeat | ||
| 732 | CRTUpdate; | ||
| 733 | SelectValue := IOSelectRead (SelectInput, Max (0, Min (NextSelectTime, TimeOutTime) - GetMicroSecondTime)); | ||
| 734 | if SelectValue = 0 then | ||
| 735 | begin | ||
| 736 | case SimulateBlockCursorCurrent of | ||
| 737 | bc_None : ; | ||
| 738 | bc_Blink : SimulateBlockCursor; | ||
| 739 | bc_Static: begin | ||
| 740 | SimulateBlockCursor; | ||
| 741 | SimulateBlockCursorCurrent := bc_None; | ||
| 742 | Dec (NeedSelect) | ||
| 743 | end | ||
| 744 | end; | ||
| 745 | NextSelectTime := GetMicroSecondTime + 120000; | ||
| 746 | p := WindowList; | ||
| 747 | repeat | ||
| 748 | with p^, WindowTypes[WindowType] do | ||
| 749 | if @PeriodicalProc <> nil then | ||
| 750 | begin | ||
| 751 | PanelActivate (Panel); | ||
| 752 | PeriodicalProc | ||
| 753 | end; | ||
| 754 | p := p^.Next | ||
| 755 | until p = WindowList | ||
| 756 | end; | ||
| 757 | until (NeedSelect = 0) or (SelectValue <> 0) or ((TimeOut >= 0) and (GetMicroSecondTime >= TimeOutTime)); | ||
| 758 | if NeedSelect = 0 then | ||
| 759 | SelectValue := 1; | ||
| 760 | if SelectValue = 0 then | ||
| 761 | Key := 0 | ||
| 762 | else | ||
| 763 | Key := ReadKeyWord; | ||
| 764 | if SimulateBlockCursorKind <> bc_None then | ||
| 765 | SimulateBlockCursorOff; | ||
| 766 | if IsDeadlySignal (Key) then Die; | ||
| 767 | if Key = kbScreenSizeChanged then CheckScreenSize; | ||
| 768 | PanelActivate (LastPanel) | ||
| 769 | end; | ||
| 770 | |||
| 771 | function Menu = n: Integer; | ||
| 772 | var | ||
| 773 | i, ax, ay: Integer; | ||
| 774 | Key: TKey; | ||
| 775 | Done: Boolean; | ||
| 776 | SSize: TPoint; | ||
| 777 | begin | ||
| 778 | n := 1; | ||
| 779 | repeat | ||
| 780 | SSize := ScreenSize; | ||
| 781 | ax := (SSize.x - MenuXSize) div 2 + 1; | ||
| 782 | ay := (SSize.y - MenuYSize) div 2 + 1; | ||
| 783 | PanelNew (ax, ay, ax + MenuXSize - 1, ay + MenuYSize - 1, False); | ||
| 784 | SetControlChars (True); | ||
| 785 | TextColor (Blue); | ||
| 786 | TextBackground (LightGray); | ||
| 787 | FrameWin (' Select Window ', DoubleFrame, True); | ||
| 788 | IgnoreCursor; | ||
| 789 | PanelNew (ax + 1, ay + 1, ax + MenuXSize - 2, ay + MenuYSize - 2, False); | ||
| 790 | ClrScr; | ||
| 791 | TextColor (Black); | ||
| 792 | SetScroll (False); | ||
| 793 | Done := False; | ||
| 794 | repeat | ||
| 795 | for i := 1 to MenuMax do | ||
| 796 | begin | ||
| 797 | GotoXY (1, i); | ||
| 798 | if i = n then | ||
| 799 | TextBackground (Green) | ||
| 800 | else | ||
| 801 | TextBackground (LightGray); | ||
| 802 | ClrEOL; | ||
| 803 | Write (' ', WindowTypes[i].Name); | ||
| 804 | ChangeTextAttr (2, i, 1, Red + $10 * GetTextBackground) | ||
| 805 | end; | ||
| 806 | Key := GetKey (-1); | ||
| 807 | case LoCaseKey (Key) of | ||
| 808 | kbUp : if n = 1 then n := MenuMax else Dec (n); | ||
| 809 | kbDown : if n = MenuMax then n := 1 else Inc (n); | ||
| 810 | kbHome, | ||
| 811 | kbPgUp, | ||
| 812 | kbCtrlPgUp, | ||
| 813 | kbCtrlHome : n := 1; | ||
| 814 | kbEnd, | ||
| 815 | kbPgDn, | ||
| 816 | kbCtrlPgDn, | ||
| 817 | kbCtrlEnd : n := MenuMax; | ||
| 818 | kbCR : Done := True; | ||
| 819 | kbEsc, kbAltEsc : begin | ||
| 820 | n := -1; | ||
| 821 | Done := True | ||
| 822 | end; | ||
| 823 | Ord ('a') .. Ord ('z'): begin | ||
| 824 | i := MenuMax; | ||
| 825 | while (i > 0) and (LoCase (Key2Char (Key)) <> LoCase (WindowTypes[i].Name[1])) do Dec (i); | ||
| 826 | if i > 0 then | ||
| 827 | begin | ||
| 828 | n := i; | ||
| 829 | Done := True | ||
| 830 | end | ||
| 831 | end; | ||
| 832 | end | ||
| 833 | until Done or (Key = kbScreenSizeChanged); | ||
| 834 | ClosePopUpWindow | ||
| 835 | until Key <> kbScreenSizeChanged | ||
| 836 | end; | ||
| 837 | |||
| 838 | procedure NewWindow (WindowType, ax, ay: Integer); | ||
| 839 | var | ||
| 840 | p, LastWindow: PWindowList; | ||
| 841 | MaxX1, MaxY1: Integer; | ||
| 842 | SSize: TPoint; | ||
| 843 | begin | ||
| 844 | New (p); | ||
| 845 | if WindowList = nil then | ||
| 846 | begin | ||
| 847 | p^.Prev := p; | ||
| 848 | p^.Next := p | ||
| 849 | end | ||
| 850 | else | ||
| 851 | begin | ||
| 852 | p^.Prev := WindowList; | ||
| 853 | p^.Next := WindowList^.Next; | ||
| 854 | p^.Prev^.Next := p; | ||
| 855 | p^.Next^.Prev := p; | ||
| 856 | end; | ||
| 857 | p^.WindowType := WindowType; | ||
| 858 | with p^, WindowTypes[WindowType] do | ||
| 859 | begin | ||
| 860 | SSize := ScreenSize; | ||
| 861 | if PrefSizeX > 0 then xs := PrefSizeX else xs := MinSizeX; | ||
| 862 | if PrefSizeY > 0 then ys := PrefSizeY else ys := MinSizeY; | ||
| 863 | xs := Min (xs + 2, SSize.x); | ||
| 864 | ys := Min (ys + 2, SSize.y); | ||
| 865 | MaxX1 := SSize.x - xs + 1; | ||
| 866 | MaxY1 := SSize.y - ys + 1; | ||
| 867 | if ax = 0 then x1 := Random (MaxX1) + 1 else x1 := Min (ax, MaxX1); | ||
| 868 | if ay = 0 then y1 := Random (MaxY1) + 1 else y1 := Min (ay, MaxY1); | ||
| 869 | if (ax = 0) and (PrefSizeX < 0) then Inc (xs, Random (SSize.x - x1 - xs + 2)); | ||
| 870 | if (ax = 0) and (PrefSizeY < 0) then Inc (ys, Random (SSize.y - y1 - ys + 2)); | ||
| 871 | State := ws_None; | ||
| 872 | PanelNew (1, 1, 1, 1, False); | ||
| 873 | FramePanel := GetActivePanel; | ||
| 874 | SetControlChars (True); | ||
| 875 | TextColor (Color); | ||
| 876 | TextBackground (Background); | ||
| 877 | PanelNew (1, 1, 1, 1, False); | ||
| 878 | SetPCCharSet (False); | ||
| 879 | Panel := GetActivePanel; | ||
| 880 | end; | ||
| 881 | LastWindow := WindowList; | ||
| 882 | WindowList := p; | ||
| 883 | if LastWindow <> nil then RedrawFrame (LastWindow); | ||
| 884 | DrawWindow (p) | ||
| 885 | end; | ||
| 886 | |||
| 887 | procedure OpenWindow; | ||
| 888 | var WindowType: Integer; | ||
| 889 | begin | ||
| 890 | WindowType := Menu; | ||
| 891 | if WindowType >= 0 then NewWindow (WindowType, 0, 0) | ||
| 892 | end; | ||
| 893 | |||
| 894 | procedure NextWindow; | ||
| 895 | var LastWindow: PWindowList; | ||
| 896 | begin | ||
| 897 | LastWindow := WindowList; | ||
| 898 | WindowList := WindowList^.Next; | ||
| 899 | PanelTop (WindowList^.FramePanel); | ||
| 900 | PanelTop (WindowList^.Panel); | ||
| 901 | RedrawFrame (LastWindow); | ||
| 902 | RedrawFrame (WindowList) | ||
| 903 | end; | ||
| 904 | |||
| 905 | procedure PreviousWindow; | ||
| 906 | var LastWindow: PWindowList; | ||
| 907 | begin | ||
| 908 | PanelMoveAbove (WindowList^.Panel, MainPanel); | ||
| 909 | PanelMoveAbove (WindowList^.FramePanel, MainPanel); | ||
| 910 | LastWindow := WindowList; | ||
| 911 | WindowList := WindowList^.Prev; | ||
| 912 | RedrawFrame (LastWindow); | ||
| 913 | RedrawFrame (WindowList) | ||
| 914 | end; | ||
| 915 | |||
| 916 | procedure CloseWindow; | ||
| 917 | var p: PWindowList; | ||
| 918 | begin | ||
| 919 | if WindowList^.WindowType <> 0 then | ||
| 920 | begin | ||
| 921 | p := WindowList; | ||
| 922 | NextWindow; | ||
| 923 | PanelDelete (p^.FramePanel); | ||
| 924 | PanelDelete (p^.Panel); | ||
| 925 | p^.Next^.Prev := p^.Prev; | ||
| 926 | p^.Prev^.Next := p^.Next; | ||
| 927 | Dispose (p) | ||
| 928 | end | ||
| 929 | end; | ||
| 930 | |||
| 931 | procedure MoveWindow; | ||
| 932 | var | ||
| 933 | Done, Changed: Boolean; | ||
| 934 | SSize: TPoint; | ||
| 935 | begin | ||
| 936 | with WindowList^ do | ||
| 937 | begin | ||
| 938 | Done := False; | ||
| 939 | Changed := True; | ||
| 940 | State := ws_Moving; | ||
| 941 | repeat | ||
| 942 | if Changed then DrawWindow (WindowList); | ||
| 943 | Changed := True; | ||
| 944 | case LoCaseKey (GetKey (-1)) of | ||
| 945 | Ord ('s'), kbLeft : if x1 > 1 then Dec (x1); | ||
| 946 | Ord ('d'), kbRight : if x1 + xs - 1 < ScreenSize.x then Inc (x1); | ||
| 947 | Ord ('e'), kbUp : if y1 > 1 then Dec (y1); | ||
| 948 | Ord ('x'), kbDown : if y1 + ys - 1 < ScreenSize.y then Inc (y1); | ||
| 949 | Ord ('a'), kbHome : x1 := 1; | ||
| 950 | Ord ('f'), kbEnd : x1 := ScreenSize.x - xs + 1; | ||
| 951 | Ord ('r'), kbPgUp : y1 := 1; | ||
| 952 | Ord ('c'), kbPgDn : y1 := ScreenSize.y - ys + 1; | ||
| 953 | Ord ('y'), kbCtrlPgUp: begin | ||
| 954 | x1 := 1; | ||
| 955 | y1 := 1 | ||
| 956 | end; | ||
| 957 | Ord ('b'), kbCtrlPgDn: begin | ||
| 958 | SSize := ScreenSize; | ||
| 959 | x1 := SSize.x - xs + 1; | ||
| 960 | y1 := SSize.y - ys + 1 | ||
| 961 | end; | ||
| 962 | kbCR, | ||
| 963 | kbEsc, kbAltEsc : Done := True; | ||
| 964 | else Changed := False | ||
| 965 | end | ||
| 966 | until Done; | ||
| 967 | State := ws_None; | ||
| 968 | DrawWindow (WindowList) | ||
| 969 | end | ||
| 970 | end; | ||
| 971 | |||
| 972 | procedure ResizeWindow; | ||
| 973 | var | ||
| 974 | Done, Changed: Boolean; | ||
| 975 | SSize: TPoint; | ||
| 976 | begin | ||
| 977 | with WindowList^, WindowTypes[WindowType] do | ||
| 978 | begin | ||
| 979 | Done := False; | ||
| 980 | Changed := True; | ||
| 981 | State := ws_Resizing; | ||
| 982 | repeat | ||
| 983 | if Changed then DrawWindow (WindowList); | ||
| 984 | Changed := True; | ||
| 985 | case LoCaseKey (GetKey (-1)) of | ||
| 986 | Ord ('s'), kbLeft : if xs > MinSizeX + 2 then Dec (xs); | ||
| 987 | Ord ('d'), kbRight : if x1 + xs - 1 < ScreenSize.x then Inc (xs); | ||
| 988 | Ord ('e'), kbUp : if ys > MinSizeY + 2 then Dec (ys); | ||
| 989 | Ord ('x'), kbDown : if y1 + ys - 1 < ScreenSize.y then Inc (ys); | ||
| 990 | Ord ('a'), kbHome : xs := MinSizeX + 2; | ||
| 991 | Ord ('f'), kbEnd : xs := ScreenSize.x - x1 + 1; | ||
| 992 | Ord ('r'), kbPgUp : ys := MinSizeY + 2; | ||
| 993 | Ord ('c'), kbPgDn : ys := ScreenSize.y - y1 + 1; | ||
| 994 | Ord ('y'), kbCtrlPgUp: begin | ||
| 995 | xs := MinSizeX + 2; | ||
| 996 | ys := MinSizeY + 2 | ||
| 997 | end; | ||
| 998 | Ord ('b'), kbCtrlPgDn: begin | ||
| 999 | SSize := ScreenSize; | ||
| 1000 | xs := SSize.x - x1 + 1; | ||
| 1001 | ys := SSize.y - y1 + 1 | ||
| 1002 | end; | ||
| 1003 | kbCR, | ||
| 1004 | kbEsc, kbAltEsc : Done := True; | ||
| 1005 | else Changed := False | ||
| 1006 | end | ||
| 1007 | until Done; | ||
| 1008 | State := ws_None; | ||
| 1009 | DrawWindow (WindowList) | ||
| 1010 | end | ||
| 1011 | end; | ||
| 1012 | |||
| 1013 | procedure ActivateCursor; | ||
| 1014 | begin | ||
| 1015 | with WindowList^, WindowTypes[WindowType] do | ||
| 1016 | begin | ||
| 1017 | PanelActivate (Panel); | ||
| 1018 | if WantCursor then | ||
| 1019 | SetCursorShape (CursorShape) | ||
| 1020 | else | ||
| 1021 | HideCursor | ||
| 1022 | end; | ||
| 1023 | SetScroll (ScrollState) | ||
| 1024 | end; | ||
| 1025 | |||
| 1026 | var | ||
| 1027 | Key: TKey; | ||
| 1028 | ScreenShot, Done: Boolean; | ||
| 1029 | |||
| 1030 | begin | ||
| 1031 | ScreenShot := ParamStr (1) = '--screenshot'; | ||
| 1032 | if ParamCount <> Ord (ScreenShot) then | ||
| 1033 | begin | ||
| 1034 | RestoreTerminal (True); | ||
| 1035 | WriteLn (StdErr, ParamStr (0), ': invalid argument `', ParamStr (Ord (ScreenShot) + 1), ''''); | ||
| 1036 | Halt (1) | ||
| 1037 | end; | ||
| 1038 | CRTSavePreviousScreen (True); | ||
| 1039 | SetCRTUpdate (UpdateInput); | ||
| 1040 | MainPanel := GetActivePanel; | ||
| 1041 | CheckScreenSize; | ||
| 1042 | OrigScreenSize := ScreenSize; | ||
| 1043 | if ScreenShot then | ||
| 1044 | begin | ||
| 1045 | CursorShape := CursorBlock; | ||
| 1046 | NewWindow (6, 1, 1); | ||
| 1047 | NewWindow (2, 1, MaxInt); | ||
| 1048 | NewWindow (8, MaxInt, 1); | ||
| 1049 | NewWindow (5, 1, 27); | ||
| 1050 | KeyDemoKey (Ord ('f')); | ||
| 1051 | KeyDemoKey (246); | ||
| 1052 | KeyDemoKey (kbDown); | ||
| 1053 | NewWindow (3, MaxInt, 13); | ||
| 1054 | NewWindow (4, MaxInt, 31); | ||
| 1055 | NewWindow (7, MaxInt, MaxInt); | ||
| 1056 | NewWindow (9, MaxInt, 33); | ||
| 1057 | NewWindow (0, 1, 2); | ||
| 1058 | NewWindow (1, 1, 14); | ||
| 1059 | ActivateCursor; | ||
| 1060 | OpenWindow | ||
| 1061 | end | ||
| 1062 | else | ||
| 1063 | NewWindow (0, 3, 2); | ||
| 1064 | Done := False; | ||
| 1065 | repeat | ||
| 1066 | ActivateCursor; | ||
| 1067 | Key := GetKey (-1); | ||
| 1068 | case LoCaseKey (Key) of | ||
| 1069 | Ord ('3'), kbF3 : OpenWindow; | ||
| 1070 | Ord ('4'), kbF4 : CloseWindow; | ||
| 1071 | Ord ('5'), kbF5 : PreviousWindow; | ||
| 1072 | Ord ('6'), kbF6 : NextWindow; | ||
| 1073 | Ord ('7'), kbF7 : MoveWindow; | ||
| 1074 | Ord ('8'), kbF8 : ResizeWindow; | ||
| 1075 | Ord ('q'), kbEsc, | ||
| 1076 | kbAltEsc: Done := True; | ||
| 1077 | else | ||
| 1078 | if WindowList <> nil then | ||
| 1079 | with WindowList^, WindowTypes[WindowType] do | ||
| 1080 | if @KeyProc <> nil then | ||
| 1081 | begin | ||
| 1082 | TextColor (Color); | ||
| 1083 | TextBackground (Background); | ||
| 1084 | KeyProc (Key) | ||
| 1085 | end | ||
| 1086 | end | ||
| 1087 | until Done | ||
| 1088 | end. | ||
diff --git a/test/indent/prolog.prolog b/test/indent/prolog.prolog index 6cb5535fe8d..8af21877b59 100644 --- a/test/indent/prolog.prolog +++ b/test/indent/prolog.prolog | |||
| @@ -200,7 +200,7 @@ elaborate(fix(F,T,B,E), Env, Ee) :- | |||
| 200 | elaborate(let(F,T,app(fix,lambda(F,T,B)),E), Env, Ee). | 200 | elaborate(let(F,T,app(fix,lambda(F,T,B)),E), Env, Ee). |
| 201 | 201 | ||
| 202 | %% elab_bindings(+TS, +Env, -TS). | 202 | %% elab_bindings(+TS, +Env, -TS). |
| 203 | %% Applique `elaborate' sur l'environnment de type TS. | 203 | %% Applique `elaborate' sur l'environnement de type TS. |
| 204 | elab_tenv([], _, []). | 204 | elab_tenv([], _, []). |
| 205 | elab_tenv([(X,T)|TS], Env, [(X, Tg)|TSe]) :- | 205 | elab_tenv([(X,T)|TS], Env, [(X, Tg)|TSe]) :- |
| 206 | elaborate(T, Env, Te), | 206 | elaborate(T, Env, Te), |
diff --git a/test/redisplay-testsuite.el b/test/redisplay-testsuite.el index afa42cc494a..f080b6db4f1 100644 --- a/test/redisplay-testsuite.el +++ b/test/redisplay-testsuite.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; redisplay-testsuite.el --- Test suite for redisplay. | 1 | ;;; redisplay-testsuite.el --- Test suite for redisplay. |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2009-2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2009-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Chong Yidong <cyd@stupidchicken.com> | 5 | ;; Author: Chong Yidong <cyd@stupidchicken.com> |
| 6 | ;; Keywords: internal | 6 | ;; Keywords: internal |
diff --git a/test/rmailmm.el b/test/rmailmm.el new file mode 100644 index 00000000000..6844eb8187b --- /dev/null +++ b/test/rmailmm.el | |||
| @@ -0,0 +1,93 @@ | |||
| 1 | ;;; rmailmm.el --- tests for mail/rmailmm.el | ||
| 2 | |||
| 3 | ;; Copyright (C) 2006-2012 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | ;; it under the terms of the GNU General Public License as published by | ||
| 9 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 10 | ;; (at your option) any later version. | ||
| 11 | |||
| 12 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | ;; GNU General Public License for more details. | ||
| 16 | |||
| 17 | ;; You should have received a copy of the GNU General Public License | ||
| 18 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | ;;; Commentary: | ||
| 21 | |||
| 22 | ;;; Code: | ||
| 23 | |||
| 24 | (require 'rmailmm) | ||
| 25 | |||
| 26 | (defun rmailmm-test-handler () | ||
| 27 | "Test of a mail using no MIME parts at all." | ||
| 28 | (let ((mail "To: alex@gnu.org | ||
| 29 | Content-Type: text/plain; charset=koi8-r | ||
| 30 | Content-Transfer-Encoding: 8bit | ||
| 31 | MIME-Version: 1.0 | ||
| 32 | |||
| 33 | \372\304\322\301\327\323\324\327\325\312\324\305\41")) | ||
| 34 | (switch-to-buffer (get-buffer-create "*test*")) | ||
| 35 | (erase-buffer) | ||
| 36 | (set-buffer-multibyte nil) | ||
| 37 | (insert mail) | ||
| 38 | (rmail-mime-show t) | ||
| 39 | (set-buffer-multibyte t))) | ||
| 40 | |||
| 41 | (defun rmailmm-test-bulk-handler () | ||
| 42 | "Test of a mail used as an example in RFC 2183." | ||
| 43 | (let ((mail "Content-Type: image/jpeg | ||
| 44 | Content-Disposition: attachment; filename=genome.jpeg; | ||
| 45 | modification-date=\"Wed, 12 Feb 1997 16:29:51 -0500\"; | ||
| 46 | Content-Description: a complete map of the human genome | ||
| 47 | Content-Transfer-Encoding: base64 | ||
| 48 | |||
| 49 | iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAALGPC/xhBQAAAAZQ | ||
| 50 | TFRF////AAAAVcLTfgAAAPZJREFUeNq9ldsOwzAIQ+3//+l1WlvA5ZLsoUiTto4TB+ISoAjy | ||
| 51 | +ITfRBfcAmgRFFeAm+J6uhdKdFhFWUgDkFsK0oUp/9G2//Kj7Jx+5tSKOdBscgUYiKHRS/me | ||
| 52 | WATQdRUvAK0Bnmshmtn79PpaLBbbOZkjKvRnjRZoRswOkG1wFchKew2g9wXVJVZL/m4+B+vv | ||
| 53 | 9AxQQR2Q33SgAYJzzVACdAWjAfRYzYFO9n6SLnydtQHSMxYDMAKqZ/8FS/lTK+zuq3CtK64L | ||
| 54 | UDwbgUEAUmk2Zyg101d6PhCDySgAvTvDgKiuOrc4dLxUb7UMnhGIexyI+d6U+ABuNAP4Simx | ||
| 55 | lgAAAABJRU5ErkJggg== | ||
| 56 | ")) | ||
| 57 | (switch-to-buffer (get-buffer-create "*test*")) | ||
| 58 | (erase-buffer) | ||
| 59 | (insert mail) | ||
| 60 | (rmail-mime-show))) | ||
| 61 | |||
| 62 | (defun rmailmm-test-multipart-handler () | ||
| 63 | "Test of a mail used as an example in RFC 2046." | ||
| 64 | (let ((mail "From: Nathaniel Borenstein <nsb@bellcore.com> | ||
| 65 | To: Ned Freed <ned@innosoft.com> | ||
| 66 | Date: Sun, 21 Mar 1993 23:56:48 -0800 (PST) | ||
| 67 | Subject: Sample message | ||
| 68 | MIME-Version: 1.0 | ||
| 69 | Content-type: multipart/mixed; boundary=\"simple boundary\" | ||
| 70 | |||
| 71 | This is the preamble. It is to be ignored, though it | ||
| 72 | is a handy place for composition agents to include an | ||
| 73 | explanatory note to non-MIME conformant readers. | ||
| 74 | |||
| 75 | --simple boundary | ||
| 76 | |||
| 77 | This is implicitly typed plain US-ASCII text. | ||
| 78 | It does NOT end with a linebreak. | ||
| 79 | --simple boundary | ||
| 80 | Content-type: text/plain; charset=us-ascii | ||
| 81 | |||
| 82 | This is explicitly typed plain US-ASCII text. | ||
| 83 | It DOES end with a linebreak. | ||
| 84 | |||
| 85 | --simple boundary-- | ||
| 86 | |||
| 87 | This is the epilogue. It is also to be ignored.")) | ||
| 88 | (switch-to-buffer (get-buffer-create "*test*")) | ||
| 89 | (erase-buffer) | ||
| 90 | (insert mail) | ||
| 91 | (rmail-mime-show t))) | ||
| 92 | |||
| 93 | ;;; rmailmm.el ends here | ||