(cond-expand (chicken-4 (use test atom rfc3339)) (else (import test atom rfc3339) (import (chicken port)))) (test "Write brief atom example from the RFC 4287 spec" #t (string=? (with-output-to-string (lambda () (write-atom-doc (make-atom-doc (make-feed title: (make-title "Example Feed") links: (list (make-link uri: "http://example.org")) updated: "2003-12-13T18:30:02Z" authors: (list (make-author name: "John Doe")) id: "urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6" entries: (list (make-entry title: (make-title "Atom-Powered Robots Run Amok") links: (list (make-link uri: "http://example.org/2003/12/13/atom03")) id: "urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a" updated: "2003-12-13T18:30:02Z" summary: (make-summary "Some text.")))))))) #< John Doe atom egg for Chicken urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6 Example Feed 2003-12-13T18:30:02Z urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a Atom-Powered Robots Run Amok 2003-12-13T18:30:02Z Some text. END )) (test "Write extensive atom example from the RFC 4287 spec" #t (string=? (with-output-to-string (lambda () (write-atom-doc (make-atom-doc (make-feed title: (make-title "dive into mark") subtitle: (make-subtitle "A lot of effort went into making this effortless" type: 'html) updated: "2005-07-31T12:29:29Z" id: "tag:example.org,2003:3" links: (list (make-link type: 'html uri-language: "en" uri: "http://example.org") (make-link relation: "self" type: "application/atom+xml" uri: "http://example.org/feed.atom")) rights: (make-rights "Copyright (c) 2003, Mark Pilgrim") generator: (make-generator "Example Toolkit" uri: "http://www.example.com" version: "1.0") entries: (list (make-entry title: (make-title "Atom draft-07 snapshot") links: (list (make-link type: 'html uri: "http://example.org/2005/04/02/atom") (make-link relation: "enclosure" type: "audio/mpeg" length: 1337 uri: "http://example.org/audio/ph34r_my_podcast.mp3")) id: "tag:example.org,2003:3.2397" updated: (rfc3339->string (make-rfc3339 2005 07 31 12 29 29 0 0)) published: (rfc3339->string (make-rfc3339 2003 12 13 08 29 29 0 (* 3600 4))) authors: (list (make-author name: "Mark Pilgrim" uri: "http://example.org" email: "f8dy@example.com")) contributors: (list (make-contributor name: "Sam Ruby") (make-contributor name: "Joe Gregorio")) ;; xml:base, xml:lang cannot be handled yet content: (make-content '(xhtml:div (xhtml:p (xhtml:i "[Update: The Atom draft is finished.]"))) type: 'xhtml)))))) )) #< Example Toolkit tag:example.org,2003:3 Copyright (c) 2003, Mark Pilgrim A <em>lot</em> of effort went into making this effortless dive into mark 2005-07-31T12:29:29Z Mark Pilgrim http://example.org f8dy@example.com Sam Ruby Joe Gregorio

[Update: The Atom draft is finished.]

tag:example.org,2003:3.2397 2003-12-13T08:29:29-04:00 Atom draft-07 snapshot 2005-07-31T12:29:29Z
END )) (test-exit)