aboutsummaryrefslogtreecommitdiffstats
path: root/test/automated
diff options
context:
space:
mode:
Diffstat (limited to 'test/automated')
-rw-r--r--test/automated/Makefile.in2
-rw-r--r--test/automated/bytecomp-tests.el2
-rw-r--r--test/automated/comint-testsuite.el2
-rw-r--r--test/automated/compile-tests.el68
-rw-r--r--test/automated/ert-tests.el10
-rw-r--r--test/automated/ert-x-tests.el2
-rw-r--r--test/automated/f90.el158
-rw-r--r--test/automated/font-parse-tests.el2
-rw-r--r--test/automated/gnus-tests.el2
-rw-r--r--test/automated/icalendar-tests.el430
-rw-r--r--test/automated/lexbind-tests.el2
-rw-r--r--test/automated/newsticker-tests.el148
-rw-r--r--test/automated/occur-tests.el2
-rw-r--r--test/automated/url-future-tests.el57
-rw-r--r--test/automated/vc-bzr.el101
15 files changed, 736 insertions, 252 deletions
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'.
305Each element has the form (STR POS COLUMN LINE FILENAME), where 305Each element has the form (STR POS COLUMN LINE FILENAME), where
306STR is an error string, POS is the position of the error in STR, 306STR 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
37program 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
60end 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
80include \"file.f90\"
81
82subroutine test (x)
83 real x
84 x = x+1.
85 return
86end 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
111type, bind(c) :: type1
112integer :: part1
113end type type1
114end 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.
56Return t if strings are equal, else return substring indicating first difference.
57FIXME: 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
368DTSTAMP:20030509T043439Z 341DTSTAMP:20030509T043439Z
369DTSTART:20030509T103000 342DTSTART:20030509T103000
@@ -373,9 +346,7 @@ LOCATION:c
373DTEND:20030509T153000 346DTEND:20030509T153000
374DESCRIPTION:b 347DESCRIPTION:b
375END:VEVENT 348END: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
397DESCRIPTION:des 368DESCRIPTION:des
398END:VEVENT 369END: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
454Argument INPUT-ISO iso style diary string. 424Argument INPUT-ISO iso style diary string.
455Argument INPUT-EUROPEAN european style diary string. 425Argument INPUT-EUROPEAN european style diary string.
456Argument INPUT-AMERICAN american style diary string. 426Argument INPUT-AMERICAN american style diary string.
457Argument EXPECTED-OUTPUT expected icalendar result string. 427Argument EXPECTED-OUTPUT expected iCalendar result string.
458 428
459European style input data must use german month names. American 429European style input data must use german month names. American
460and ISO style input data must use english month names." 430and 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.
499Argument INPUT input diary string. 469Argument INPUT input diary string.
500Argument EXPECTED-OUTPUT expected icalendar result string." 470Argument 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.
738Argument EXPECTED-OUTPUT expected diary string." 708Argument 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
754DTSTART;VALUE=DATE-TIME:20030919T090000 722DTSTART;VALUE=DATE-TIME:20030919T090000
755DTEND;VALUE=DATE-TIME:20030919T113000" 723DTEND;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
761DTSTART;VALUE=DATE-TIME:20030919" 729DTSTART;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")
769DTSTART;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
775SUMMARY:Sommerferien 742SUMMARY: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
857DTEND;VALUE=DATE-TIME:20030919T113000 825DTEND;VALUE=DATE-TIME:20030919T113000
858RRULE:FREQ=DAILY; 826RRULE: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
867DTEND;VALUE=DATE-TIME:20030919T113000 835DTEND;VALUE=DATE-TIME:20030919T113000
868RRULE:FREQ=DAILY;INTERVAL=2 836RRULE: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
875DTSTART;VALUE=DATE-TIME:20030919T090000 843DTSTART;VALUE=DATE-TIME:20030919T090000
@@ -877,36 +845,36 @@ DTEND;VALUE=DATE-TIME:20030919T113000
877RRULE:FREQ=DAILY;INTERVAL=2 845RRULE:FREQ=DAILY;INTERVAL=2
878EXDATE:20030921,20030925 846EXDATE: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
885DTSTART;VALUE=DATE-TIME:20030919T090000 853DTSTART;VALUE=DATE-TIME:20030919T090000
886DTEND;VALUE=DATE-TIME:20030919T113000 854DTEND;VALUE=DATE-TIME:20030919T113000
887RRULE:FREQ=WEEKLY; 855RRULE: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
894DTSTART;VALUE=DATE-TIME:20030919T090000 862DTSTART;VALUE=DATE-TIME:20030919T090000
895DTEND;VALUE=DATE-TIME:20030919T113000 863DTEND;VALUE=DATE-TIME:20030919T113000
896RRULE:FREQ=MONTHLY; 864RRULE: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
903DTSTART;VALUE=DATE-TIME:20030919T090000 871DTSTART;VALUE=DATE-TIME:20030919T090000
904DTEND;VALUE=DATE-TIME:20030919T113000 872DTEND;VALUE=DATE-TIME:20030919T113000
905RRULE:FREQ=MONTHLY;UNTIL=20050819; 873RRULE: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
912DTEND;VALUE=DATE:20040816 880DTEND;VALUE=DATE:20040816
@@ -914,81 +882,81 @@ SUMMARY:Maria Himmelfahrt
914UID:CC56BEA6-49D2-11D8-8833-00039386D1C2-RID 882UID:CC56BEA6-49D2-11D8-8833-00039386D1C2-RID
915RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=8 883RRULE: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
922DTSTART;VALUE=DATE-TIME:20030919T090000 890DTSTART;VALUE=DATE-TIME:20030919T090000
923DTEND;VALUE=DATE-TIME:20030919T113000 891DTEND;VALUE=DATE-TIME:20030919T113000
924RRULE:FREQ=YEARLY;INTERVAL=2 892RRULE: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
931DTSTART;VALUE=DATE-TIME:20030919T090000 899DTSTART;VALUE=DATE-TIME:20030919T090000
932DTEND;VALUE=DATE-TIME:20030919T113000 900DTEND;VALUE=DATE-TIME:20030919T113000
933RRULE:FREQ=DAILY;COUNT=1;INTERVAL=1 901RRULE: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
940DTSTART;VALUE=DATE-TIME:20030919T090000 908DTSTART;VALUE=DATE-TIME:20030919T090000
941DTEND;VALUE=DATE-TIME:20030919T113000 909DTEND;VALUE=DATE-TIME:20030919T113000
942RRULE:FREQ=DAILY;COUNT=14;INTERVAL=1 910RRULE: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
949DTSTART;VALUE=DATE-TIME:20030919T090000 917DTSTART;VALUE=DATE-TIME:20030919T090000
950DTEND;VALUE=DATE-TIME:20030919T113000 918DTEND;VALUE=DATE-TIME:20030919T113000
951RRULE:FREQ=WEEKLY;COUNT=3;INTERVAL=2 919RRULE: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
958DTSTART;VALUE=DATE-TIME:20030919T090000 926DTSTART;VALUE=DATE-TIME:20030919T090000
959DTEND;VALUE=DATE-TIME:20030919T113000 927DTEND;VALUE=DATE-TIME:20030919T113000
960RRULE:FREQ=MONTHLY;INTERVAL=1;COUNT=5 928RRULE: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
967DTSTART;VALUE=DATE-TIME:20030919T090000 935DTSTART;VALUE=DATE-TIME:20030919T090000
968DTEND;VALUE=DATE-TIME:20030919T113000 936DTEND;VALUE=DATE-TIME:20030919T113000
969RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=5 937RRULE: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
976DTSTART;VALUE=DATE-TIME:20030919T090000 944DTSTART;VALUE=DATE-TIME:20030919T090000
977DTEND;VALUE=DATE-TIME:20030919T113000 945DTEND;VALUE=DATE-TIME:20030919T113000
978RRULE:FREQ=YEARLY;INTERVAL=1;COUNT=5 946RRULE: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
985DTSTART;VALUE=DATE-TIME:20030919T090000 953DTSTART;VALUE=DATE-TIME:20030919T090000
986DTEND;VALUE=DATE-TIME:20030919T113000 954DTEND;VALUE=DATE-TIME:20030919T113000
987RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=5 955RRULE: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
998SUMMARY:duration 966SUMMARY:duration
999DURATION:P7D 967DURATION: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
1006DTSTAMP:20041127T183315Z 974DTSTAMP:20041127T183315Z
@@ -1014,11 +982,11 @@ SEQUENCE:1
1014CREATED:20041127T183329 982CREATED: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
1038SUMMARY: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
1046PRODID:-//Emacs//NONSGML icalendar.el//EN
1047VERSION:2.0\nBEGIN:VEVENT
1048DTSTART;VALUE=DATE:20110723
1049SUMMARY:event-1
1050END:VEVENT
1051END:VCALENDAR
1052BEGIN:VCALENDAR
1053PRODID:-//Emacs//NONSGML icalendar.el//EN
1054VERSION:2.0
1055BEGIN:VEVENT
1056DTSTART;VALUE=DATE:20110724
1057SUMMARY:event-2
1058END:VEVENT
1059END:VCALENDAR
1060BEGIN:VCALENDAR
1061PRODID:-//Emacs//NONSGML icalendar.el//EN
1062VERSION:2.0
1063BEGIN:VEVENT
1064DTSTART;VALUE=DATE:20110725
1065SUMMARY:event-3a
1066END:VEVENT
1067BEGIN:VEVENT
1068DTSTART;VALUE=DATE:20110725
1069SUMMARY:event-3b
1070END:VEVENT
1071END: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
1383DTEND;VALUE=DATE:20050609 1399DTEND;VALUE=DATE:20050609
1384SUMMARY:ff") 1400SUMMARY: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
1785DTSTAMP:20050118T210335Z 1805DTSTAMP:20050118T210335Z
1786DURATION:P7D" 1806DURATION: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/automated/newsticker-tests.el b/test/automated/newsticker-tests.el
new file mode 100644
index 00000000000..5b60535e463
--- /dev/null
+++ b/test/automated/newsticker-tests.el
@@ -0,0 +1,148 @@
1;;; newsticker-testsuite.el --- Test suite for newsticker.
2
3;; Copyright (C) 2003-2012 Free Software Foundation, Inc.
4
5;; Author: Ulf Jasper <ulf.jasper@web.de>
6;; Keywords: News, RSS, Atom
7
8;; This file is part of GNU Emacs.
9
10;; GNU Emacs is free software: you can redistribute it and/or modify
11;; it under the terms of the GNU General Public License as published by
12;; the Free Software Foundation, either version 3 of the License, or
13;; (at your option) any later version.
14
15;; GNU Emacs is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; GNU General Public License for more details.
19
20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22
23;;; Commentary:
24
25;;; Code:
26
27(require 'ert)
28(require 'newsticker)
29
30;; ======================================================================
31;; Tests for newsticker-backend
32;; ======================================================================
33(ert-deftest newsticker--guid ()
34 "Test for `newsticker--guid-*'.
35Signals an error if something goes wrong."
36 (should (string= "blah" (newsticker--guid-to-string "blah")))
37 (should (string= "myguid" (newsticker--guid '("title1" "description1" "link1"
38 nil 'new 42 nil nil
39 ((guid () "myguid")))))))
40
41(ert-deftest newsticker--cache-contains ()
42 "Test for `newsticker--cache-contains'."
43 (let ((newsticker--cache '((feed1
44 ("title1" "description1" "link1" nil 'new 42
45 nil nil ((guid () "myguid")))))))
46 (newsticker--guid-to-string
47 (assoc 'guid (newsticker--extra '("title1" "description1"
48 "link1" nil 'new 42 nil nil
49 ((guid "myguid"))))))
50 (should (newsticker--cache-contains newsticker--cache 'feed1 "WRONGTITLE"
51 "description1" "link1" 'new "myguid"))
52 (should (not (newsticker--cache-contains newsticker--cache 'feed1 "title1"
53 "description1" "link1" 'new
54 "WRONG GUID")))
55 (should (newsticker--cache-contains newsticker--cache 'feed1 "title1"
56 "description1" "link1" 'new "myguid")))
57 (let ((newsticker--cache '((feed1
58 ("title1" "description1" "link1" nil 'new 42
59 nil nil ((guid () "myguid1")))
60 ("title1" "description1" "link1" nil 'new 42
61 nil nil ((guid () "myguid2")))))))
62 (should (not (newsticker--cache-contains newsticker--cache 'feed1 "title1"
63 "description1" "link1" 'new
64 "myguid")))
65 (should (string= "myguid1"
66 (newsticker--guid (newsticker--cache-contains
67 newsticker--cache 'feed1 "title1"
68 "description1" "link1" 'new
69 "myguid1"))))
70 (should (string= "myguid2"
71 (newsticker--guid (newsticker--cache-contains
72 newsticker--cache 'feed1 "title1"
73 "description1" "link1" 'new
74 "myguid2"))))))
75
76(defun newsticker-tests--decode-iso8601-date (input expected)
77 "Actually test `newsticker--decode-iso8601-date'.
78Apply to INPUT and compare with EXPECTED."
79 (let ((result (format-time-string "%Y-%m-%dT%H:%M:%S"
80 (newsticker--decode-iso8601-date input)
81 t)))
82 (should (string= result expected))))
83
84(ert-deftest newsticker--decode-iso8601-date ()
85 "Test `newsticker--decode-iso8601-date'."
86 (newsticker-tests--decode-iso8601-date "2004"
87 "2004-01-01T00:00:00")
88 (newsticker-tests--decode-iso8601-date "2004-09"
89 "2004-09-01T00:00:00")
90 (newsticker-tests--decode-iso8601-date "2004-09-17"
91 "2004-09-17T00:00:00")
92 (newsticker-tests--decode-iso8601-date "2004-09-17T05:09"
93 "2004-09-17T05:09:00")
94 (newsticker-tests--decode-iso8601-date "2004-09-17T05:09:49"
95 "2004-09-17T05:09:49")
96 (newsticker-tests--decode-iso8601-date "2004-09-17T05:09:49.123"
97 "2004-09-17T05:09:49")
98 (newsticker-tests--decode-iso8601-date "2004-09-17T05:09+01:00"
99 "2004-09-17T04:09:00")
100 (newsticker-tests--decode-iso8601-date "2004-09-17T05:09-02:00"
101 "2004-09-17T07:09:00"))
102
103(defun newsticker--do-test--decode-rfc822-date (input expected)
104 "Actually test `newsticker--decode-rfc822-date'.
105Apply to INPUT and compare with EXPECTED."
106 (let ((result (format-time-string "%Y-%m-%dT%H:%M:%S"
107 (newsticker--decode-rfc822-date input)
108 t)))
109 (should (string= result expected))))
110
111(ert-deftest newsticker--decode-rfc822-date ()
112 "Test `newsticker--decode-rfc822-date'."
113 (newsticker--do-test--decode-rfc822-date "Mon, 10 Mar 2008 19:27:52 +0100"
114 "2008-03-10T18:27:52")
115 ;;(format-time-string "%d.%m.%y, %H:%M %T%z"
116 ;;(newsticker--decode-rfc822-date "Mon, 10 Mar 2008 19:27:52 +0200"))
117
118 (newsticker--do-test--decode-rfc822-date "Mon, 10 Mar 2008 19:27:52"
119 "2008-03-10T19:27:52")
120 (newsticker--do-test--decode-rfc822-date "Mon, 10 Mar 2008 19:27"
121 "2008-03-10T19:27:00")
122 (newsticker--do-test--decode-rfc822-date "10 Mar 2008 19:27"
123 "2008-03-10T19:27:00")
124 (newsticker--do-test--decode-rfc822-date "Mon, 10 Mar 2008"
125 "2008-03-10T00:00:00")
126 (newsticker--do-test--decode-rfc822-date "10 Mar 2008"
127 "2008-03-10T00:00:00")
128 (newsticker--do-test--decode-rfc822-date "Sat, 01 Dec 2007 00:05:00 +0100"
129 "2007-11-30T23:05:00")
130 (newsticker--do-test--decode-rfc822-date "Sun, 30 Dec 2007 18:58:13 +0100"
131 "2007-12-30T17:58:13"))
132
133;; ======================================================================
134;; Tests for newsticker-treeview
135;; ======================================================================
136(ert-deftest newsticker--group-manage-orphan-feeds ()
137 "Test `newsticker--group-manage-orphan-feeds'.
138Signals an error if something goes wrong."
139 (let ((newsticker-groups '("Feeds"))
140 (newsticker-url-list-defaults nil)
141 (newsticker-url-list '(("feed1") ("feed2") ("feed3"))))
142 (newsticker--group-manage-orphan-feeds)
143 (should (equal '("Feeds" "feed3" "feed2" "feed1")
144 newsticker-groups))))
145
146(provide 'newsticker-tests)
147
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