From 8ac9d4176e8f82285427f698b824fb69df601df8 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 20 Apr 2023 01:14:03 +0200 Subject: 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. --- test/xfdf.lisp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'test') 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 @@ ")))) + +(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 + " + + + + + + 2 + + + Homer J. + + + Simpson + + + + + + + Annoyed grunt! + + + + +")))) -- cgit v1.2.3