aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTeddy Wing2023-04-16 19:55:53 +0200
committerTeddy Wing2023-04-16 19:55:53 +0200
commit0fdcbf0a159c9ee4df69bad2c617de01dcb0fd3c (patch)
treefae2919fc7fcd11f389e6a2f5bf04f87ef79b7b3 /src
parent3347a25d6abc00f0cbcea893282eef949ca9b25f (diff)
downloadxfdf-0fdcbf0a159c9ee4df69bad2c617de01dcb0fd3c.tar.bz2
Add test system
Write a test for the `write-xfdf` function. Worked out how to create the test system from: - https://lispcookbook.github.io/cl-cookbook/testing.html - https://github.com/sjl/cl-digraph/blob/master/cl-digraph.test.asd - https://github.com/fukamachi/dexador/blob/master/dexador-test.asd Add the test string to the `write-xfdf` function to pass the test and check that the test runner is set up correctly.
Diffstat (limited to 'src')
-rw-r--r--src/package.lisp4
-rw-r--r--src/xfdf.lisp17
2 files changed, 18 insertions, 3 deletions
diff --git a/src/package.lisp b/src/package.lisp
index d535a24..e914975 100644
--- a/src/package.lisp
+++ b/src/package.lisp
@@ -1,2 +1,4 @@
(defpackage :xfdf
- (:use :cl))
+ (:use :cl)
+
+ (:export #:write-xfdf))
diff --git a/src/xfdf.lisp b/src/xfdf.lisp
index 315c63c..a61fcdd 100644
--- a/src/xfdf.lisp
+++ b/src/xfdf.lisp
@@ -1,13 +1,26 @@
(in-package :xfdf)
(defun write-xfdf (output-stream fields)
- (format output-stream "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+ (format output-stream "~
+<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<xfdf xmlns=\"http://ns.adobe.com/xfdf/\" xml:space=\"preserve\">
<fields>
")
;; TODO
; (loop do)
+ (format output-stream " <field name=\"checkbox-on\">
+ <value>Yes</value>
+ </field>
+ <field name=\"checkbox-off\">
+ <value>Off</value>
+ </field>
+ <field name=\"text\">
+ <value>123 Fake Street, Springfield</value>
+ </field>
+")
(format output-stream " </fields>
-</xfdf>"))
+</xfdf>")
+
+ output-stream)