1 ;;; Tests for bbdb-vcard.el
3 ;; Before proceeding, you should probably save your production bbdb file.
5 ;; To run the tests, eval this file.
6 ;; In case of failure, find test results in buffer `bbdb-vcard-test-result'.
8 ;; For the sake of minimality, not all test cases are rfc compliant.
13 (defun bbdb-vcard-import-test
14 (vcard bbdb-entry search-name
15 &optional search-company search-net check-creation-date-p
)
16 "Import VCARD and search for it in bbdb by SEARCH-NAME,
17 SEARCH-COMPANY, (perhaps later) SEARCH-NET. If search result
18 disagrees with BBDB-ENTRY, talk about it in buffer
19 bbdb-vcard-test-result. timestamp and, if CHECK-CREATION-DATE-P is
20 nil, creation-date are not taken into account."
21 (bbdb-vcard-iterate-vcards 'bbdb-vcard-import-vcard vcard
)
22 (let* ((search-company (or search-company
""))
24 (car (bbdb-search (bbdb-search (bbdb-records) search-name
)
25 nil search-company
))))
26 (setf (cdr (assoc 'timestamp
(elt bbdb-search-result
7))) "2010-03-04"
27 (cdr (assoc 'timestamp
(elt bbdb-entry
7))) "2010-03-04")
28 (unless check-creation-date-p
29 (setf (cdr (assoc 'creation-date
(elt bbdb-search-result
7))) "2010-03-04"
30 (cdr (assoc 'creation-date
(elt bbdb-entry
7))) "2010-03-04"))
31 (unless (equal (subseq bbdb-search-result
0 8)
32 (subseq bbdb-entry
0 8))
33 (princ "\nTest failed:\n" (get-buffer-create "bbdb-vcard-test-result"))
34 (prin1 vcard
(get-buffer-create "bbdb-vcard-test-result"))
35 (princ "\nwas stored as\n" (get-buffer-create "bbdb-vcard-test-result"))
36 (prin1 (subseq bbdb-search-result
0 8)
37 (get-buffer-create "bbdb-vcard-test-result"))
38 (princ "\nbut was expected as\n" (get-buffer-create "bbdb-vcard-test-result"))
39 (prin1 bbdb-entry
(get-buffer-create "bbdb-vcard-test-result")))))
41 (defun bbdb-vcard-normalize-notes (notes)
42 "Sort a BBDB NOTES field and delete the timestamps in order to make them
43 comparable after re-import."
44 (let ((notes (remove-alist 'notes
'timestamp
)))
45 (setq notes
(remove-alist 'notes
'creation-date
))
48 '(lambda (x y
) (if (string= (symbol-name (car x
)) (symbol-name (car y
)))
49 (string< (cdr x
) (cdr y
))
50 (string< (symbol-name (car x
)) (symbol-name (car y
))))))))
52 (defun bbdb-vcard-normalize-record (record)
53 "Make BBDB RECORD comparable by deleting certain things and sorting others."
54 (setf (elt record
6) (bbdb-vcard-normalize-notes (elt record
7)))
57 (defun bbdb-vcard-compare-bbdbs (first-bbdb second-bbdb
)
58 "Compare two BBDB record lists. Tell about mismatches in buffer
59 `bbdb-vcard-test-result'."
61 first-record second-record
)
62 (while (or (nth i first-bbdb
) (nth i second-bbdb
))
63 (unless (equal (bbdb-vcard-normalize-record (nth i first-bbdb
))
64 (bbdb-vcard-normalize-record (nth i second-bbdb
)))
65 (princ "\nRe-import: comparison of these records failed:"
66 (get-buffer-create "bbdb-vcard-test-result"))
67 (print (bbdb-vcard-normalize-record (nth i first-bbdb
))
68 (get-buffer-create "bbdb-vcard-test-result"))
69 (prin1 (bbdb-vcard-normalize-record (nth i second-bbdb
))
70 (get-buffer-create "bbdb-vcard-test-result")))
74 ;;; Try not to mess up our real BBDB:
76 (save-buffer bbdb-buffer
)
77 (kill-buffer bbdb-buffer
))
78 (when (get-buffer "test-bbdb") (kill-buffer "test-bbdb"))
79 (setq bbdb-file
"/tmp/test-bbdb")
80 (when (file-exists-p bbdb-file
) (delete-file bbdb-file
))
81 (when (get-buffer "bbdb-vcard-test-result") (kill-buffer "bbdb-vcard-test-result"))
85 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
87 (bbdb-vcard-import-test
89 ** A vcard without any type parameters.
90 ------------------------------------------------------------
100 ADR:Box111;Room 111;First Street,First Corner;Cityone;First State;11111;Country
103 EMAIL:first1@provider1
106 GEO:37.386013;-122.082932
107 TITLE:Director\\, Research and Development
110 AGENT:CID:JQPUBLIC.part3.960129T083020.xyzMail@host3.com
111 ORG:Company1;Unit1;Subunit1
113 NOTE:This vcard uses every type defined in rfc2426.
114 PRODID:-//ONLINE DIRECTORY//NONSGML Version 1//EN
115 REV:1995-10-31T22:27:10Z
119 URL:http://first1.host1.org
122 X-foo:extended type 1
130 (["Office" "+11111111"])
132 ("Box111" "Room 111" "First Street" "First Corner")
138 ((x-foo .
"extended type 1")
139 (key .
"The Key No 1")
140 (class .
"CONFIDENTIAL")
141 (uid .
"111-111-111-111")
143 (sort-string .
"aaa000")
144 (prodid .
"-//ONLINE DIRECTORY//NONSGML Version 1//EN")
145 (agent .
"CID:JQPUBLIC.part3.960129T083020.xyzMail@host3.com")
146 (logo .
"encoded logo #1")
147 (role .
"Programmer")
148 (title .
"Director, Research and Development")
149 (geo .
"37.386013;-122.082932")
151 (mailer .
"Wanderlust1")
153 (photo .
"The Alphabet:abcdefghijklmnopqrstuvwsyz")
154 (mail-alias .
"category1")
155 (anniversary .
"1999-12-05 birthday")
156 (notes .
"This vcard uses every type defined in rfc2426.")
157 (www .
"http://first1.host1.org")
158 (creation-date .
"1995-10-31T22:27:10Z") (timestamp .
"2010-03-04"))]
163 (bbdb-vcard-import-test
165 ** Bad vCard: semi-colons where they don't belong
166 ------------------------------------------------------------
171 NICKNAME:Firsty2,or; something
176 ADR:Box111;Room 111;First Street,First Corner;Cityone;First State;11111;Country
177 LABEL:Label 1;Label 2
178 TEL:+11111111;+222222
179 EMAIL:first1@provider1
180 MAILER:Wanderlust1;Wanderlust2
182 GEO:37.386013;-122.082932
183 TITLE:Director\\, Research; and Development
186 AGENT:CID:JQPUBLIC.part3.960129T083020.xyzMail@host3.com
187 ORG:Company1;Unit1;Subunit1
189 NOTE:This isn't a decent vCard. It shouldn't render our bbdb unusable. We don't expect it to re-import unchanged, though.
190 REV:1995-10-31T22:27:10Z
194 URL:http://first1.host1.org; My home
197 X-foo:extended type 1
201 ("First2; Last2" "Firsty2" "or; something")
205 (["Office" "+11111111;+222222"])
206 (["Office" ("Box111" "Room 111" "First Street" "First Corner") "Cityone" "First State" "11111" "Country"])
208 ((x-foo .
"extended type 1")
209 (key .
"The Key No 1")
210 (class .
"CONFIDENTIAL")
211 (uid .
"111-111-111-111")
213 (sort-string .
"aaa000")
214 (agent .
"CID:JQPUBLIC.part3.960129T083020.xyzMail@host3.com")
215 (logo .
"encoded logo #1")
216 (role .
"Programmer")
217 (title .
"Director, Research; and Development")
218 (geo .
"37.386013;-122.082932")
220 (mailer .
"Wanderlust1;Wanderlust2")
221 (label .
"Label 1;Label 2")
222 (photo .
"The Alphabet:abcdefghij;klmnopqrstuvwsyz")
223 (mail-alias .
"category1")
224 (anniversary .
"1999-12-05 birthday")
225 (notes .
"This isn't a decent vCard. It shouldn't render our bbdb unusable. We don't expect it to re-import unchanged, though.")
226 (www .
"http://first1.host1.org; My home")
227 (creation-date .
"1995-10-31T22:27:10Z") (timestamp .
"2010-03-04"))]
232 (bbdb-vcard-import-test
234 ** The following is made of examples from rfc2426.
235 ------------------------------------------------------------
238 FN:Mr. John Q. Public\\, Esq.
239 N:Stevenson;John;Philip,Paul;Dr.;Jr.,M.D.,A.C.P.
241 PHOTO;VALUE=uri:http://www.abc.com/pub/photos
244 ADR;TYPE=dom,home,postal,parcel:;;123 Main
245 Street;Any Town;CA;91921-1234
246 LABEL;TYPE=dom,home,postal,parcel:Mr.John Q. Public\\, Esq.\\n
247 Mail Drop: TNE QB\\n123 Main Street\\nAny Town\\, CA 91921-1234
249 TEL;TYPE=work,voice,pref,msg:+1-213-555-1234
250 EMAIL;TYPE=internet:jqpublic@xyz.dom1.com
251 EMAIL;TYPE=internet:jdoe@isp.net
252 MAILER:PigeonMail 2.1
254 GEO:37.386013;-122.082932
255 TITLE:Director\\, Research and Development
257 LOGO;ENCODING=b;TYPE=JPEG:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN
258 AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm
259 ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
261 CID:JQPUBLIC.part3.960129T083020.xyzMail@host3.com
262 ORG:ABC\\, Inc.;North American Division;Marketing
263 CATEGORIES:TRAVEL AGENT
264 NOTE:This fax number is operational 0800 to 1715
266 PRODID:-//ONLINE DIRECTORY//NONSGML Version 1//EN
267 REV:1995-10-31T22:27:10Z
268 SOUND;TYPE=BASIC;ENCODING=b:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN
269 AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm
270 ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
271 UID:19950401-080045-40000F192713-0052
272 URL:http://www.swbyps.restaurant.french/~chezchic.html
274 KEY;ENCODING=b:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcNAQEEBQA
275 wdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENbW11bmljYX
276 Rpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
277 ZW1zMRwwGgYDVQQDExNyb290Y2EubmV0c2NhcGUuY29tMB4XDTk3MDYwNj
278 E5NDc1OVoXDTk3MTIwMzE5NDc1OVowgYkxCzAJBgNVBAYTAlVTMSYwJAYD
279 VQQKEx1OZXRzY2FwZSBDb21tdW5pY2F0aW9ucyBDb3JwLjEYMBYGA1UEAx
280 MPVGltb3RoeSBBIEhvd2VzMSEwHwYJKoZIhvcNAQkBFhJob3dlc0BuZXRz
281 Y2FwZS5jb20xFTATBgoJkiaJk/IsZAEBEwVob3dlczBcMA0GCSqGSIb3DQ
282 EBAQUAA0sAMEgCQQC0JZf6wkg8pLMXHHCUvMfL5H6zjSk4vTTXZpYyrdN2
283 dXcoX49LKiOmgeJSzoiFKHtLOIboyludF90CgqcxtwKnAgMBAAGjNjA0MB
284 EGCWCGSAGG+EIBAQQEAwIAoDAfBgNVHSMEGDAWgBT84FToB/GV3jr3mcau
285 +hUMbsQukjANBgkqhkiG9w0BAQQFAAOBgQBexv7o7mi3PLXadkmNP9LcIP
286 mx93HGp0Kgyx1jIVMyNgsemeAwBM+MSlhMfcpbTrONwNjZYW8vJDSoi//y
287 rZlVt9bJbs7MNYZVsyF1unsqaln4/vy6Uawfg8VUMk1U7jt8LYpo4YULU7
288 UZHPYVUaSgVttImOHZIKi4hlPXBOhcUQ==
291 ["Dr. John Philip Paul" "Stevenson Jr. M.D. A.C.P."
292 ("Mr. John Q. Public, Esq." "Robbie")
294 North American Division
296 (["Office" "+1-213-555-1234"])
303 ("jqpublic@xyz.dom1.com" "jdoe@isp.net")
304 ((key\
;encoding=b . "MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcNAQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENbW11bmljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0ZW1zMRwwGgYDVQQDExNyb290Y2EubmV0c2NhcGUuY29tMB4XDTk3MDYwNjE5NDc1OVoXDTk3MTIwMzE5NDc1OVowgYkxCzAJBgNVBAYTAlVTMSYwJAYDVQQKEx1OZXRzY2FwZSBDb21tdW5pY2F0aW9ucyBDb3JwLjEYMBYGA1UEAxMPVGltb3RoeSBBIEhvd2VzMSEwHwYJKoZIhvcNAQkBFhJob3dlc0BuZXRzY2FwZS5jb20xFTATBgoJkiaJk/IsZAEBEwVob3dlczBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQC0JZf6wkg8pLMXHHCUvMfL5H6zjSk4vTTXZpYyrdN2dXcoX49LKiOmgeJSzoiFKHtLOIboyludF90CgqcxtwKnAgMBAAGjNjA0MBEGCWCGSAGG+EIBAQQEAwIAoDAfBgNVHSMEGDAWgBT84FToB/GV3jr3mcau+hUMbsQukjANBgkqhkiG9w0BAQQFAAOBgQBexv7o7mi3PLXadkmNP9LcIPmx93HGp0Kgyx1jIVMyNgsemeAwBM+MSlhMfcpbTrONwNjZYW8vJDSoi//yrZlVt9bJbs7MNYZVsyF1unsqaln4/vy6Uawfg8VUMk1U7jt8LYpo4YULU7UZHPYVUaSgVttImOHZIKi4hlPXBOhcUQ==")
306 (uid .
"19950401-080045-40000F192713-0052")
307 (sound\
;type=basic\;encoding=b . "MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcNAQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bmljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0")
308 (prodid .
"-//ONLINE DIRECTORY//NONSGML Version 1//EN")
309 (agent\
;value=uri . "CID:JQPUBLIC.part3.960129T083020.xyzMail@host3.com")
310 (logo\
;encoding=b\;type=jpeg . "MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcNAQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bmljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0")
311 (role .
"Programmer")
312 (title .
"Director, Research and Development")
313 (geo .
"37.386013;-122.082932")
315 (mailer .
"PigeonMail 2.1")
316 (label\
;type=dom\,home\,postal\,parcel . "Mr.John Q. Public, Esq.
319 Any Town
, CA
91921-
1234
321 (photo\;value=uri . "http
://www.abc.com
/pub
/photos
/jqpublic.gif
")
322 (mail-alias . "TRAVEL AGENT
")
323 (anniversary . "1996-
04-
15 birthday
")
324 (notes . "This fax number is operational
0800 to
1715 EST
, Mon-Fri.
")
325 (www . "http
://www.swbyps.restaurant.french
/~chezchic.html
")
326 (creation-date . "1995-
10-
31T22
:27:10Z
") (timestamp . "2010-
03-
04"))]
331 (bbdb-vcard-import-test
333 ** Exactly the same as before.
334 Re-reading it shouldn
't duplicate anything.
335 ------------------------------------------------------------
338 FN
:Mr. John Q. Public
\\, Esq.
339 N
:Stevenson
;John;Philip,Paul;Dr.;Jr.,M.D.,A.C.P.
341 PHOTO
;VALUE=uri:http://www.abc.com/pub/photos
344 ADR
;TYPE=dom,home,postal,parcel:;;123 Main
345 Street
;Any Town;CA;91921-1234
346 LABEL
;TYPE=dom,home,postal,parcel:Mr.John Q. Public\\, Esq.\\n
347 Mail Drop
: TNE QB
\\n123 Main Street
\\nAny Town
\\, CA
91921-
1234
349 TEL
;TYPE=work,voice,pref,msg:+1-213-555-1234
350 EMAIL
;TYPE=internet:jqpublic@xyz.dom1.com
351 EMAIL
;TYPE=internet:jdoe@isp.net
352 MAILER
:PigeonMail
2.1
354 GEO
:37.386013;-122.082932
355 TITLE
:Director
\\, Research and Development
357 LOGO
;ENCODING=b;TYPE=JPEG:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN
358 AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm
359 ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
361 CID
:JQPUBLIC.part3.960129T083020.xyzMail
@host3.com
362 ORG
:ABC
\\, Inc.
;North American Division;Marketing
363 CATEGORIES
:TRAVEL AGENT
364 NOTE
:This fax number is operational
0800 to
1715
366 PRODID
:-
//ONLINE DIRECTORY
//NONSGML Version
1//EN
367 REV
:1995-
10-
31T22
:27:10Z
368 SOUND
;TYPE=BASIC;ENCODING=b:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN
369 AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm
370 ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
371 UID
:19950401-
080045-
40000F192713-0052
372 URL
:http
://www.swbyps.restaurant.french
/~chezchic.html
374 KEY
;ENCODING=b:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcNAQEEBQA
375 wdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENbW11bmljYX
376 Rpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
377 ZW1zMRwwGgYDVQQDExNyb290Y2EubmV0c2NhcGUuY29tMB4XDTk3MDYwNj
378 E5NDc1OVoXDTk3MTIwMzE5NDc1OVowgYkxCzAJBgNVBAYTAlVTMSYwJAYD
379 VQQKEx1OZXRzY2FwZSBDb21tdW5pY2F0aW9ucyBDb3JwLjEYMBYGA1UEAx
380 MPVGltb3RoeSBBIEhvd2VzMSEwHwYJKoZIhvcNAQkBFhJob3dlc0BuZXRz
381 Y2FwZS5jb20xFTATBgoJkiaJk
/IsZAEBEwVob3dlczBcMA0GCSqGSIb3DQ
382 EBAQUAA0sAMEgCQQC0JZf6wkg8pLMXHHCUvMfL5H6zjSk4vTTXZpYyrdN2
383 dXcoX49LKiOmgeJSzoiFKHtLOIboyludF90CgqcxtwKnAgMBAAGjNjA0MB
384 EGCWCGSAGG
+EIBAQQEAwIAoDAfBgNVHSMEGDAWgBT84FToB
/GV3jr3mcau
385 +hUMbsQukjANBgkqhkiG9w0BAQQFAAOBgQBexv7o7mi3PLXadkmNP9LcIP
386 mx93HGp0Kgyx1jIVMyNgsemeAwBM
+MSlhMfcpbTrONwNjZYW8vJDSoi
//y
387 rZlVt9bJbs7MNYZVsyF1unsqaln4
/vy6Uawfg8VUMk1U7jt8LYpo4YULU7
388 UZHPYVUaSgVttImOHZIKi4hlPXBOhcUQ
==
391 ["Dr. John Philip Paul
" "Stevenson Jr. M.D. A.C.P.
"
392 ("Mr. John Q. Public
, Esq.
" "Robbie
")
394 North American Division
396 (["Office
" "+1-
213-
555-
1234"])
403 ("jqpublic
@xyz.dom1.com
" "jdoe
@isp.net
")
404 ((key\;encoding=b . "MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcNAQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENbW11bmljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0ZW1zMRwwGgYDVQQDExNyb290Y2EubmV0c2NhcGUuY29tMB4XDTk3MDYwNjE5NDc1OVoXDTk3MTIwMzE5NDc1OVowgYkxCzAJBgNVBAYTAlVTMSYwJAYDVQQKEx1OZXRzY2FwZSBDb21tdW5pY2F0aW9ucyBDb3JwLjEYMBYGA1UEAxMPVGltb3RoeSBBIEhvd2VzMSEwHwYJKoZIhvcNAQkBFhJob3dlc0BuZXRzY2FwZS5jb20xFTATBgoJkiaJk
/IsZAEBEwVob3dlczBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQC0JZf6wkg8pLMXHHCUvMfL5H6zjSk4vTTXZpYyrdN2dXcoX49LKiOmgeJSzoiFKHtLOIboyludF90CgqcxtwKnAgMBAAGjNjA0MBEGCWCGSAGG
+EIBAQQEAwIAoDAfBgNVHSMEGDAWgBT84FToB
/GV3jr3mcau
+hUMbsQukjANBgkqhkiG9w0BAQQFAAOBgQBexv7o7mi3PLXadkmNP9LcIPmx93HGp0Kgyx1jIVMyNgsemeAwBM
+MSlhMfcpbTrONwNjZYW8vJDSoi
//yrZlVt9bJbs7MNYZVsyF1unsqaln4
/vy6Uawfg8VUMk1U7jt8LYpo4YULU7UZHPYVUaSgVttImOHZIKi4hlPXBOhcUQ
==")
406 (uid . "19950401-
080045-
40000F192713-0052
")
407 (sound\;type=basic\;encoding=b . "MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcNAQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bmljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
")
408 (prodid . "-
//ONLINE DIRECTORY
//NONSGML Version
1//EN
")
409 (agent\;value=uri . "CID
:JQPUBLIC.part3.960129T083020.xyzMail
@host3.com
")
410 (logo\;encoding=b\;type=jpeg . "MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcNAQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bmljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
")
411 (role . "Programmer
")
412 (title . "Director
, Research and Development
")
413 (geo . "37.386013;-122.082932")
415 (mailer .
"PigeonMail 2.1")
416 (label\
;type=dom\,home\,postal\,parcel . "Mr.John Q. Public, Esq.
419 Any Town
, CA
91921-
1234
421 (photo\;value=uri . "http
://www.abc.com
/pub
/photos
/jqpublic.gif
")
422 (www . "http
://www.swbyps.restaurant.french
/~chezchic.html
")
423 (mail-alias . "TRAVEL AGENT
")
424 (anniversary . "1996-
04-
15 birthday
")
425 (notes . "This fax number is operational
0800 to
1715 EST
, Mon-Fri.
")
426 (creation-date . "1995-
10-
31T22
:27:10Z
") (timestamp . "2010-
03-
04"))]
431 (bbdb-vcard-import-test
433 ** Re-use of existing BBDB entries.
435 ------------------------------------------------------------
440 EMAIL
:userA
@hostA.example.com
449 ("userA
@hostA.example.com
")
450 ((creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04")) ]
454 (bbdb-vcard-import-test
456 *** The same again
; shouldn't change the previous one.
457 ------------------------------------------------------------
462 EMAIL
:userA
@hostA.example.com
471 ("userA
@hostA.example.com
")
472 ((creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04")) ]
476 (bbdb-vcard-import-test
478 *** Same N
, same ORG
, different EMAIL
, which should be added to the previous
480 ------------------------------------------------------------
485 EMAIL
:personA
@example.com
494 ("userA
@hostA.example.com
" "personA
@example.com
")
495 ((creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04")) ]
499 (bbdb-vcard-import-test
501 *** Same N
, same ORG
, no EMAIL
; shouldn't change anything.
502 ------------------------------------------------------------
515 ("userA
@hostA.example.com
" "personA
@example.com
")
516 ((creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04")) ]
520 (bbdb-vcard-import-test
522 *** Same N
, same EMAIL
, no ORG
; shouldn't change anything.
523 ------------------------------------------------------------
527 EMAIL
:userA
@hostA.example.com
536 ("userA
@hostA.example.com
" "personA
@example.com
")
537 ((creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04")) ]
541 (bbdb-vcard-import-test
543 *** Same N
, same EMAIL
, different ORG by which Company of the previous one
545 ------------------------------------------------------------
550 EMAIL
:userA
@hostA.example.com
559 ("userA
@hostA.example.com
" "personA
@example.com
")
560 ((creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04")) ]
564 (bbdb-vcard-import-test
566 *** Different N
, same EMAIL
, same ORG
; should go into a fresh entry.
567 ------------------------------------------------------------
572 EMAIL
:userA
@hostA.example.com
575 ["FirstA1
" "FamilyA1
"
581 ("userA
@hostA.example.com
")
582 ((creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04")) ]
587 (bbdb-vcard-import-test
589 ** AKA has various sources
; duplicates are being discarded.
590 ------------------------------------------------------------
594 A.N
:PseudonymB
;FirstB
595 FN
:The FirstB of FamilyB
596 A.FN
:FirstB1 FamilyB1
597 B.FN
:FirstB2 FamilyB2
599 NICKNAME
:Bee
,Effy Bee
,FirstB FamilyB
605 "The FirstB of FamilyB
"
613 ((creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04"))]
617 (bbdb-vcard-import-test
619 ** Additional ORGs go to Notes
, org.
620 ------------------------------------------------------------
635 (creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04")) ]
639 (bbdb-vcard-import-test
641 *** ... but only if they are unique
642 ------------------------------------------------------------
662 (creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04")) ]
666 (bbdb-vcard-import-test
668 ** Prefixes are discarded.
669 ------------------------------------------------------------
674 X.EMAIL
:userD
@hostD.example.com
683 ("userD
@hostD.example.com
")
684 ((creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04")) ]
688 (bbdb-vcard-import-test
690 *** Same as before
, don
't change anything.
691 ------------------------------------------------------------
696 EMAIL
:userD
@hostD.example.com
705 ("userD
@hostD.example.com
")
706 ((creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04")) ]
710 (bbdb-vcard-import-test
712 *** Same as before
, don
't change anything.
713 ------------------------------------------------------------
718 Y.EMAIL
:userD
@hostD.example.com
727 ("userD
@hostD.example.com
")
728 ((creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04")) ]
732 (bbdb-vcard-import-test
734 ** Case Insensitivity
735 ------------------------------------------------------------
740 email
:userE
@hostE.example.com
749 ("userE
@hostE.example.com
")
750 ((creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04")) ]
754 (bbdb-vcard-import-test
757 ------------------------------------------------------------
762 NICKNAME
:Fränzchen
,Rübe
763 ADR
:Postschließfach
17;Zimmer Zwölf;Einbahnstraße;Ödstadt;;75480;
768 ("Fränzchen
" "Rübe
")
772 ("Postschließfach
17" "Zimmer Zwölf
" "Einbahnstraße
")
778 ((creation-date . "2010-
03-
06") (timestamp . "2010-
03-
06")) ]
782 (bbdb-vcard-import-test
784 *** Multiple
, structured ADR
785 ------------------------------------------------------------
790 ADR
;TYPE=dom,home,postal,parcel:Box111,LHS;Room 111,or not;First Street,First Corner;Cityone;First State;11111,22222;Country
791 ADR
;TYPE=intl,work,postal,parcel:Box222,RHS;Room 22,or something;Second Street,First Corner;Citytwo;Second State;222,33333;Country
792 ADR
;TYPE=dom,work,postal,parcel:;;Second Street,First Corner;Citytwo;;222,33333;
793 ADR
;TYPE=intl;TYPE=home;TYPE=parcel:;;Third Street,First Corner;Citythree;;222,33333;
802 ("Box111
" "LHS
" "Room
111" "or not
" "First Street
" "First Corner
")
808 ("Box222
" "RHS
" "Room
22" "or something
" "Second Street
" "First Corner
")
814 ("Second Street
" "First Corner
")
820 ("Third Street
" "First Corner
")
826 ((creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04"))]
830 (bbdb-vcard-import-test
832 *** Skip types from bbdb-vcard-skip-on-import
833 ------------------------------------------------------------
838 EMAIL
:userH
@hostH.example.com
849 ("userH
@hostH.example.com
")
850 ((creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04")) ]
854 (bbdb-vcard-import-test
856 *** Skip empty types.
857 ------------------------------------------------------------
862 EMAIL
:userG
@hostG.example.com
874 ("userG
@hostG.example.com
")
875 ((creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04")) ]
879 (bbdb-vcard-import-test
881 *** Remove X-BBDB- prefixes
882 ------------------------------------------------------------
887 EMAIL
:userN
@hostN.example.com
889 X-BBDB-TEX-NAME
:{\\\\em FirstM FamilyM
}
898 ("userN
@hostN.example.com
")
899 ((tex-name . "{\\em FirstM FamilyM
}")
901 (creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04"))]
905 (bbdb-vcard-import-test
907 ** Merging of vcard NOTEs
908 *** A vcard with two NOTEs.
909 ------------------------------------------------------------
924 ((notes . "Note No.
1a
;\nNote No. 1b")
925 (creation-date .
"2010-03-04") (timestamp .
"2010-03-04")) ]
929 (bbdb-vcard-import-test
931 *** Same as before, but a different NOTE.
932 ------------------------------------------------------------
946 ((notes .
"Note No. 1a;\nNote No. 1b;\nNote No. 2")
947 (creation-date .
"2010-03-04") (timestamp .
"2010-03-04")) ]
951 (bbdb-vcard-import-test
953 *** Same as before, but a NOTE we've seen already
954 ------------------------------------------------------------
968 ((notes .
"Note No. 1a;\nNote No. 1b;\nNote No. 2")
969 (creation-date .
"2010-03-04") (timestamp .
"2010-03-04")) ]
974 (bbdb-vcard-import-test
976 ** Merging of vcard CATEGORIES
977 *** A vcard with two CATEGORIES.
978 ------------------------------------------------------------
983 CATEGORIES:Category 1a,Category 1b
984 CATEGORIES:Category 2a,Category 2b
993 ((mail-alias .
"Category 1a,Category 1b,Category 2a,Category 2b")
994 (creation-date .
"2010-03-04") (timestamp .
"2010-03-04"))]
998 (bbdb-vcard-import-test
1000 *** Same as before, but a different CATEGORIES.
1001 ------------------------------------------------------------
1006 CATEGORIES:Category 3
1015 ((mail-alias .
"Category 1a,Category 1b,Category 2a,Category 2b,Category 3")
1016 (creation-date .
"2010-03-04") (timestamp .
"2010-03-04"))]
1020 (bbdb-vcard-import-test
1022 *** Same as before, but a CATEGORIES we've seen already
1023 ------------------------------------------------------------
1028 CATEGORIES:Category 2b
1037 ((mail-alias .
"Category 1a,Category 1b,Category 2a,Category 2b,Category 3")
1038 (creation-date .
"2010-03-04") (timestamp .
"2010-03-04"))]
1042 (bbdb-vcard-import-test
1044 ** A vcard with two other vcards inside; we check the outer one
1045 ------------------------------------------------------------
1048 FN:OuterfirstA OuterlastA
1049 N:OuterlastA OuterfirstA
1050 AGENT:BEGIN:VCARD\\nVERSION:3.0\\nN:InnerlastA\\;InnerfirstA\\nFN:InnerfirstA InnerlastA\\nTEL:+1-919-555-
1051 1234\\nEMAIL\\;TYPE=INTERNET:InnerA@hostA.com\\nEND:VCARD\\n
1052 B.AGENT:BEGIN:VCARD\\nVERSION:3.0\\nN:InnerlastB\\;InnerfirstB\\nFN:InnerfirstB InnerlastB\\nTEL:+1-919-555-
1053 1234\\nEMAIL\\;TYPE=INTERNET:InnerB@hostB.com\\nEND:VCARD\\n
1057 ["OuterlastA" "OuterfirstA"
1058 ("OuterfirstA OuterlastA")
1063 ((b\.agent .
"BEGIN:VCARD
1065 N:InnerlastB;InnerfirstB
1066 FN:InnerfirstB InnerlastB
1068 EMAIL;TYPE=INTERNET:InnerB@hostB.com
1071 (agent .
"BEGIN:VCARD
1073 N:InnerlastA;InnerfirstA
1074 FN:InnerfirstA InnerlastA
1076 EMAIL;TYPE=INTERNET:InnerA@hostA.com
1080 (creation-date .
"2010-03-04") (timestamp .
"2010-03-04")) ]
1081 "OuterfirstA OuterlastA")
1084 (bbdb-vcard-import-test
1086 ** A vcard with two other vcards inside; we check the first inner one
1087 ------------------------------------------------------------
1090 FN:OuterfirstA OuterlastA
1091 N:OuterlastA OuterfirstA
1092 AGENT:BEGIN:VCARD\\nVERSION:3.0\\nN:InnerlastA\\;InnerfirstA\\nFN:InnerfirstA InnerlastA\\nTEL:+1-919-555-
1093 1234\\nEMAIL\\;TYPE=INTERNET:InnerA@hostA.com\\nEND:VCARD\\n
1094 B.AGENT:BEGIN:VCARD\\nVERSION:3.0\\nN:InnerlastB\\;InnerfirstB\\nFN:InnerfirstB InnerlastB\\nTEL:+1-919-555-
1095 1234\\nEMAIL\\;TYPE=INTERNET:InnerB@hostB.com\\nEND:VCARD\\n
1099 ["InnerfirstA" "InnerlastA"
1102 (["Office" "+1-919-555-1234"])
1104 ("InnerA@hostA.com")
1105 ((creation-date .
"2010-03-04") (timestamp .
"2010-03-04"))]
1106 "InnerfirstA InnerlastA")
1109 (bbdb-vcard-import-test
1111 ** A vcard with two other vcards inside; we check the second inner one
1112 ------------------------------------------------------------
1115 FN:OuterfirstA OuterlastA
1116 N:OuterlastA OuterfirstA
1117 AGENT:BEGIN:VCARD\\nVERSION:3.0\\nN:InnerlastA\\;InnerfirstA\\nFN:InnerfirstA InnerlastA\\nTEL:+1-919-555-
1118 1234\\nEMAIL\\;TYPE=INTERNET:InnerA@hostA.com\\nEND:VCARD\\n
1119 B.AGENT:BEGIN:VCARD\\nVERSION:3.0\\nN:InnerlastB\\;InnerfirstB\\nFN:InnerfirstB InnerlastB\\nTEL:+1-919-555-
1120 1234\\nEMAIL\\;TYPE=INTERNET:InnerB@hostB.com\\nEND:VCARD\\n
1124 ["InnerfirstB" "InnerlastB"
1127 (["Office" "+1-919-555-1234"])
1129 ("InnerB@hostB.com")
1130 ((creation-date .
"2010-03-04") (timestamp .
"2010-03-04"))]
1131 "InnerfirstB InnerlastB")
1134 (bbdb-vcard-import-test
1137 *** Store REV as creation-date in new records...
1138 ------------------------------------------------------------
1143 REV:1997-03-27T22:27:10Z
1152 ((creation-date .
"1997-03-27T22:27:10Z") (timestamp .
"2010-03-04")) ]
1157 (bbdb-vcard-import-test
1159 *** ...but not in existing records
1160 ------------------------------------------------------------
1165 REV:1977-12-03T22:27:10Z
1174 ((creation-date .
"1997-03-27T22:27:10Z") (timestamp .
"2010-03-04")) ]
1179 (bbdb-vcard-import-test
1181 *** The same, but dashless REV
1182 ------------------------------------------------------------
1187 REV:19771203T222710Z
1196 ((creation-date .
"1977-12-03T22:27:10Z") (timestamp .
"2010-03-04")) ]
1202 (bbdb-vcard-import-test
1204 ** Matching BDAY and N induce merge
1205 *** Storing a new person
1206 ------------------------------------------------------------
1220 ((anniversary .
"1927-03-27 birthday")
1221 (creation-date .
"2010-03-04") (timestamp .
"2010-03-04")) ]
1225 (bbdb-vcard-import-test
1227 *** Not quite the same person: BDAY differs.
1228 ------------------------------------------------------------
1242 ((anniversary .
"1937-04-28 birthday")
1243 (creation-date .
"2010-03-04") (timestamp .
"2010-03-04")) ]
1248 (bbdb-vcard-import-test
1250 *** Known person due to matching BDAY. Different ORG, though.
1251 ------------------------------------------------------------
1265 ((anniversary .
"1927-03-27 birthday")
1266 (creation-date .
"2010-03-04") (timestamp .
"2010-03-04")) ]
1271 (bbdb-vcard-import-test
1273 *** Known person due to matching BDAY (albeit in another date format). Different ORG, again.
1274 ------------------------------------------------------------
1288 ((anniversary .
"1927-03-27 birthday")
1289 (creation-date .
"2010-03-04") (timestamp .
"2010-03-04")) ]
1295 (bbdb-vcard-import-test
1298 ** Birthdays include time.
1299 ------------------------------------------------------------
1303 BDAY:1927-03-27T23:44:54Z
1312 ((anniversary .
"1927-03-27T23:44:54Z birthday")
1313 (creation-date .
"2010-03-04") (timestamp .
"2010-03-04"))]
1317 (bbdb-vcard-import-test
1319 ** Birthdays include time (half-obsolete format).
1320 ------------------------------------------------------------
1324 BDAY:19580327T234454
1333 ((anniversary .
"1958-03-27T23:44:54 birthday")
1334 (creation-date .
"2010-03-04") (timestamp .
"2010-03-04"))]
1338 (bbdb-vcard-import-test
1340 ** Non-birthday anniversaries
1341 ------------------------------------------------------------
1346 X-BBDB-ANNIVERSARY:1960-12-12 wedding\\n1970-11-11 blah\\n1998-03-12 %s created bbdb-anniv.el %d years ago
1355 ((anniversary .
"1927-03-27 birthday\n1960-12-12 wedding\n1970-11-11 blah\n1998-03-12 %s created bbdb-anniv.el %d years ago")
1356 (creation-date .
"2010-03-04") (timestamp .
"2010-03-04"))]
1360 (bbdb-vcard-import-test
1362 ** Non-birthday anniversaries, no BDAY
1363 ------------------------------------------------------------
1367 X-BBDB-ANNIVERSARY:1960-12-12 wedding\\n1970-11-11 blah
1376 ((anniversary .
"1960-12-12 wedding\n1970-11-11 blah")
1377 (creation-date .
"2010-03-04") (timestamp .
"2010-03-04"))]
1382 (bbdb-vcard-import-test
1384 ** No BDAY, but unlabelled birthday in anniversary
1385 ------------------------------------------------------------
1389 X-BBDB-ANNIVERSARY:1960-12-12\\n1970-11-11 blah
1390 NOTE:On re-import, birthday gets labelled.
1391 Therefore, re-import test of this one should fail.
1400 ((anniversary .
"1960-12-12\n1970-11-11 blah")
1401 (notes .
"On re-import, birthday gets labelled. Therefore, re-import test of this one should fail.")
1402 (creation-date .
"2010-03-04") (timestamp .
"2010-03-04"))]
1407 (bbdb-vcard-import-test
1409 ** Matching TEL and N induce merge
1410 *** Storing a new person
1411 ------------------------------------------------------------
1415 TEL;TYPE=work:111100001
1416 TEL;TYPE=home:111100002
1424 (["Office" "111100001"]
1425 ["Home" "111100002"]
1426 ["Office" "111100003"]
1430 ((creation-date .
"2010-03-04") (timestamp .
"2010-03-04"))]
1434 (bbdb-vcard-import-test
1436 *** Not quite the same person: no matching TEL.
1437 ------------------------------------------------------------
1441 TEL;TYPE=work:222200001
1442 TEL;TYPE=home:222200002
1450 (["Office" "222200001"]
1451 ["Home" "222200002"]
1452 ["Office" "222200003"])
1455 ((creation-date .
"2010-03-04") (timestamp .
"2010-03-04"))]
1460 (bbdb-vcard-import-test
1462 *** Known person: matching TEL (but different ORG).
1463 ------------------------------------------------------------
1467 TEL;TYPE=work:333300001
1468 TEL;TYPE=work:111100002
1476 (["Office" "111100003"]
1477 ["Home" "111100002"]
1478 ["Office" "111100001"]
1479 ["Office" "333300001"]
1480 ["Office" "111100002"]
1481 ["Office" "333300003"])
1484 ((creation-date .
"2010-03-04") (timestamp .
"2010-03-04"))]
1490 (bbdb-vcard-import-test
1492 ** From RFC 2426: author's address. Note the omission or type N
1493 which is declared mandatory by this very RFC.
1494 ------------------------------------------------------------
1498 ORG:Lotus Development Corporation
1499 ADR;TYPE=WORK,POSTAL,PARCEL:;;6544 Battleford Drive
1500 ;Raleigh;NC;27613-3502;U.S.A.
1501 TEL;TYPE=VOICE,MSG,WORK:+1-919-676-9515
1502 TEL;TYPE=FAX,WORK:+1-919-676-9564
1503 EMAIL;TYPE=INTERNET,PREF:Frank_Dawson@Lotus.com
1504 EMAIL;TYPE=INTERNET:fdawson@earthlink.net
1505 URL:http://home.earthlink.net/~fdawson
1510 "Lotus Development Corporation"
1511 (["Office" "+1-919-676-9515"] ["Office" "+1-919-676-9564"])
1513 ("6544 Battleford Drive")
1518 ("Frank_Dawson@Lotus.com" "fdawson@earthlink.net")
1519 ((www .
"http://home.earthlink.net/~fdawson")
1520 (creation-date .
"2010-03-04") (timestamp .
"2010-03-04"))]
1523 (bbdb-vcard-import-test
1525 ** The other author of RFC 2426
1526 ------------------------------------------------------------
1530 ORG:Netscape Communications Corp.
1531 ADR;TYPE=WORK:;;501 E. Middlefield Rd.;Mountain View;
1533 TEL;TYPE=VOICE,MSG,WORK:+1-415-937-3419
1534 TEL;TYPE=FAX,WORK:+1-415-528-4164
1535 EMAIL;TYPE=INTERNET:howes@netscape.com
1540 "Netscape Communications Corp."
1541 (["Office" "+1-415-937-3419"]
1542 ["Office" "+1-415-528-4164"])
1544 ("501 E. Middlefield Rd.")
1549 ("howes@netscape.com")
1550 ((creation-date .
"2010-03-04") (timestamp .
"2010-03-04"))]
1555 (bbdb-vcard-import-test
1557 ** vCard version 2.1
1558 ------------------------------------------------------------
1562 TEL;WORK;VOICE:+1-213-555-1234
1563 TEL;WORK;FAX:+1-213-555-5678
1564 BDAY:19661221t173745
1570 (["Office" "+1-213-555-1234"]
1571 ["Office" "+1-213-555-5678"])
1574 ((anniversary .
"1966-12-21T17:37:45 birthday") (creation-date .
"2010-03-04") (timestamp .
"2010-03-04"))]
1578 (bbdb-vcard-import-test
1580 ** vCard version 2.1
1581 *** Case insensitivity
1582 ------------------------------------------------------------
1586 tel;WORK;VOICE:+1-213-555-1234
1587 tel;WORK;FAX:+1-213-555-5678
1593 (["Office" "+1-213-555-1234"]
1594 ["Office" "+1-213-555-5678"])
1597 ((creation-date .
"2010-03-04") (timestamp .
"2010-03-04"))]
1601 (bbdb-vcard-import-test
1603 ** vCard version 2.1
1604 ------------------------------------------------------------
1607 N:Smith;John;M.;Mr.;Esq.
1608 TEL;WORK;VOICE;MSG:+1 (919) 555-1234
1609 TEL;CELL:+1 (919) 554-6758
1610 TEL;WORK;FAX:+1 (919) 555-9876
1611 ADR;WORK;PARCEL;POSTAL;DOM:Suite 101;1 Central St.;AnyTown;NC;27654
1614 ["Mr. John M." "Smith Esq."
1617 (["Office" "+1 (919) 555-1234"]
1618 ["Mobile" "+1 (919) 554-6758"]
1619 ["Office" "+1 (919) 555-9876"])
1620 (["Office" ("Suite 101" "1 Central St." "AnyTown") "NC" "27654" "" ""])
1622 ((creation-date .
"2010-03-04") (timestamp .
"2010-03-04"))]
1626 (bbdb-vcard-import-test
1628 ** vCard version 2.1
1629 *** Quoted-printable
1630 ------------------------------------------------------------
1635 ORG:Doe Company, The;
1637 NOTE;ENCODING=QUOTED-PRINTABLE: This is a note associated
1638 with this contact=0D=0A
1639 TEL;WORK;VOICE:(987) 123-4567
1640 TEL;HOME;VOICE:(987) 765-4321
1641 TEL;CELL;VOICE:(987) 135-8642
1642 TEL;WORK;FAX:(987) 246-1357
1643 ADR;WORK:;;1234 North Street;Anytown;TX 751234;;United States
1645 LABEL;WORK;ENCODING=QUOTED-PRINTABLE:1234 North Street=0D=0AAnytown,
1646 TX 751234 =0D=0AUnited States of America
1648 URL:<WWLINK TYPE=\"GENERIC\"
1649 VALUE=\"http://www.doeweb.com\">http://www.doeweb.com</WWLINK>
1650 EMAIL;PREF;INTERNET:jdoe@nowhere.com
1651 REV:19980114T170559Z
1658 (["Office" "(987) 123-4567"]
1659 ["Home" "(987) 765-4321"]
1660 ["Mobile" "(987) 135-8642"]
1661 ["Office" "(987) 246-1357"])
1662 (["Office" ("1234 North Street") "Anytown" "TX 751234" "" "United States of America"])
1663 ("jdoe@nowhere.com")
1664 ((label\
;type=work . "1234 North Street
1666 United States of America
")
1667 (title . "President
")
1668 (notes . "This is a note associated with this contact
1670 (www . "http
://www.doeweb.com
")
1671 (creation-date . "1998-
01-
14T17
:05:59Z
") (timestamp . "2010-
03-
04"))]
1677 (bbdb-vcard-import-test
1679 ** A v2.1 vcard with another vcard inside
; we check the outer one
1680 ------------------------------------------------------------
1683 N
:Outerlast2A
; Outerfirst2A
1684 FN
:Outerfirst2A Outerlast2A
1685 AGENT
:BEGIN
:VCARD
\\nVERSION
:2.1\\nN
:Innerlast2A
\\;Innerfirst2A\\nFN:Innerfirst2A Innerlast2A\\nTEL:+1-919-555-
1686 1234\\nEMAIL
\\;TYPE=INTERNET:InnerA@hostA.com\\nEND:VCARD\\n
1690 [" Outerfirst2A
" "Outerlast2A
"
1691 ("Outerfirst2A Outerlast2A
")
1696 ((agent . "BEGIN
:VCARD
\\
1698 N
:Innerlast2A
\\;Innerfirst2A\\
1699 FN
:Innerfirst2A Innerlast2A
\\
1700 TEL
:+1-
919-
555-
1234\\
1701 EMAIL
\\;TYPE=INTERNET:InnerA@hostA.com\\
1705 (creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04"))]
1706 "Outerfirst2A Outerlast2A
")
1709 (bbdb-vcard-import-test
1711 ** A v2.1 vcard with another vcard inside
; we check the inner one
1712 ------------------------------------------------------------
1715 N
:Outerlast2A Outerfirst2A
1716 AGENT
:BEGIN
:VCARD
\\nVERSION
:2.1\\nN
:Innerlast2A
\\;Innerfirst2A\\nFN:Innerfirst2A Innerlast2A\\nTEL:+1-919-555-
1717 1234\\nEMAIL
\\;TYPE=INTERNET:InnerA@hostA.com\\nEND:VCARD\\n
1721 ["Innerfirst2A
" "Innerlast2A
"
1724 (["Office
" "+1-
919-
555-
1234"])
1726 ("InnerA
@hostA.com
")
1727 ((creation-date . "2010-
03-
04") (timestamp . "2010-
03-
04"))]
1728 "Innerfirst2A Innerlast2A
")
1732 ;;;; The Export/Re-Import Tests
1733 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1736 (with-current-buffer "*BBDB
*"
1737 (bbdb-vcard-export "/tmp
/test-bbdb-0.vcf
" t nil))
1739 (let ((first-bbdb (bbdb-search (bbdb-records) ""))
1742 (save-buffer bbdb-buffer)
1743 (kill-buffer bbdb-buffer)
1744 (kill-buffer "*BBDB
*")
1745 (delete-file "/tmp
/test-bbdb
")
1746 (bbdb-vcard-import-file "/tmp
/test-bbdb-0.vcf
")
1747 (setq second-bbdb (bbdb-search (bbdb-records) ""))
1748 (bbdb-vcard-compare-bbdbs first-bbdb second-bbdb))
1749 ;; FIXME: previous line messes bbdb up.