From 20f86d289bdb8cbdc622a500f4b96aff9e87ec45 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Wed, 4 Oct 2023 10:36:52 +0200 Subject: tests: rename example to atom --- tests/atom.scm | 30 ++++++++++++++++++++++++++++++ tests/example.scm | 30 ------------------------------ 2 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 tests/atom.scm delete mode 100644 tests/example.scm diff --git a/tests/atom.scm b/tests/atom.scm new file mode 100644 index 0000000..5d47ef6 --- /dev/null +++ b/tests/atom.scm @@ -0,0 +1,30 @@ +(define-module (tests atom) + #:use-module (src dates) + #:use-module (srfi srfi-64) + #:use-module ((src atom) #:prefix atom:)) + +(test-begin "Atom feed") + +(define me (atom:person "Ekaitz" + #:email "ekaitz@elenq.tech" + #:uri "https://elenq.tech")) + +(define feed + (atom:feed #:title "Mi feed" + #:subtitle "Este es mi feed" + #:uri "https://feed.elenq.tech" + #:entries (list + (atom:entry #:title "first entry" + #:published (string/ISO->date "2023-03-01") + #:authors (list me) + #:summary-html '(p "Este es el resumen") + #:content-html '(p "Este es el contenido") + #:categories (list "una" "dos" "tres") + #:media (list))))) + ;; TODO: Test media (reads file) + +(let ((atom-feed (with-output-to-string (lambda () (atom:render feed))))) + (test-assert (string=? atom-feed + "https://feed.elenq.techMi feed2023-03-01T00:00:00+0100Este es mi feedhttps://feed.elenq.tech/first-entryfirst entry2023-03-01T00:00:00+01002023-03-01T00:00:00+0100Ekaitzhttps://elenq.techekaitz@elenq.tech

Este es el resumen

Este es el contenido

"))) + +(test-end "Atom feed") diff --git a/tests/example.scm b/tests/example.scm deleted file mode 100644 index 5d47ef6..0000000 --- a/tests/example.scm +++ /dev/null @@ -1,30 +0,0 @@ -(define-module (tests atom) - #:use-module (src dates) - #:use-module (srfi srfi-64) - #:use-module ((src atom) #:prefix atom:)) - -(test-begin "Atom feed") - -(define me (atom:person "Ekaitz" - #:email "ekaitz@elenq.tech" - #:uri "https://elenq.tech")) - -(define feed - (atom:feed #:title "Mi feed" - #:subtitle "Este es mi feed" - #:uri "https://feed.elenq.tech" - #:entries (list - (atom:entry #:title "first entry" - #:published (string/ISO->date "2023-03-01") - #:authors (list me) - #:summary-html '(p "Este es el resumen") - #:content-html '(p "Este es el contenido") - #:categories (list "una" "dos" "tres") - #:media (list))))) - ;; TODO: Test media (reads file) - -(let ((atom-feed (with-output-to-string (lambda () (atom:render feed))))) - (test-assert (string=? atom-feed - "https://feed.elenq.techMi feed2023-03-01T00:00:00+0100Este es mi feedhttps://feed.elenq.tech/first-entryfirst entry2023-03-01T00:00:00+01002023-03-01T00:00:00+0100Ekaitzhttps://elenq.techekaitz@elenq.tech

Este es el resumen

Este es el contenido

"))) - -(test-end "Atom feed") -- cgit v1.2.3