diff options
author | Teddy Wing | 2023-04-20 01:14:03 +0200 |
---|---|---|
committer | Teddy Wing | 2023-04-20 01:20:43 +0200 |
commit | 8ac9d4176e8f82285427f698b824fb69df601df8 (patch) | |
tree | 8567d502da7caf190d27eca67181d6375c046cf1 | |
parent | 46171912f7e1322b9e9ccdb74c4225abc5d17e81 (diff) | |
download | xfdf-8ac9d4176e8f82285427f698b824fb69df601df8.tar.bz2 |
test: Add test for hierarchical form
Checkboxes don't work on IRS tax forms using the current flat XFDF
structure. In order to activate them, their values must be set using a
nested, or hierarchical field structure.
Add a test to facilitate development of nested XFDF field generation.
-rw-r--r-- | test/xfdf.lisp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/xfdf.lisp b/test/xfdf.lisp index 854538e..63416ea 100644 --- a/test/xfdf.lisp +++ b/test/xfdf.lisp @@ -29,3 +29,47 @@ </field> </fields> </xfdf>")))) + +(test generates-hierarchical-xfdf + (let ((xfdf-string + (with-output-to-string (xfdf-stream) + (xfdf:write-xfdf + xfdf-stream + '(("topmostSubform[0]" + . (("Page1[0]" + . (("c1_01[1]" . "2") + ("f1_02[0]" . "Homer J.") + ("f1_03[0]" . "Simpson"))) + ("Page2[0]" + . (("f2_02[0]" . "1234"))))) + ("bottommostSubform[0]" + . (("Page1[0]" + . (("f1_01[0]" . "Annoyed grunt!")))))))))) + + (is (string= + xfdf-string + "<?xml version=\"1.0\" encoding=\"UTF-8\"?> +<xfdf xmlns=\"http://ns.adobe.com/xfdf/\" xml:space=\"preserve\"> + <fields> + <field name=\"topmostSubform[0]\"> + <field name=\"Page1[0]\"> + <field name=\"c1_01[1]\"> + <value>2</value> + </field> + <field name=\"f1_02[0]\"> + <value>Homer J.</value> + </field> + <field name=\"f1_03[0]\"> + <value>Simpson</value> + </field> + </field> + </field> + <field name=\"bottommostSubform[0]\"> + <field name=\"Page1[0]\"> + <field name=\"f1_01[0]\"> + <value>Annoyed grunt!</value> + </field> + </field> + </field> + </fields> +</xfdf>")))) |