Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding keys test_05 changes padding output for HIPx #92

Open
philshafer opened this issue Mar 2, 2024 · 2 comments
Open

adding keys test_05 changes padding output for HIPx #92

philshafer opened this issue Mar 2, 2024 · 2 comments
Assignees

Comments

@philshafer
Copy link
Contributor

philshafer commented Mar 2, 2024

This patch adds keys to an instance, but changes the output under HIPx (html+info+pretty+xpath). I think the "-14.14" is getting lost.

Thanks,
Phil

--- a/tests/core/test_05.c
+++ b/tests/core/test_05.c
@@ -123,8 +123,8 @@ main (int argc, char **argv)
 	    "{T:/%-12s}{T:Time (%)}\n", "Department");
     for ( ; ep->e_first; ep++) {
 	xo_open_instance("employee");
-	xo_emit("{[:-25}{:first-name/%s} ({:nic-name/\"%s\"}){]:}"
-		"{:last-name/%-14..14s/%s}"
+	xo_emit("{[:-25}{k:first-name/%s} ({k:nic-name/\"%s\"}){]:}"
+		"{k:last-name/%-14..14s/%s}"
 		"{:department/%8u}{:percent-time/%8u}\n",
 		ep->e_first, ep->e_nic, ep->e_last, ep->e_dept, ep->e_percent);
 	if (ep->e_percent > 50) {
... test_05.c ... T ...
... test_05.c ... XP ...
... test_05.c ... JP ...
... test_05.c ... JPu ...
... test_05.c ... HP ...
... test_05.c ... X ...
... test_05.c ... J ...
... test_05.c ... H ...
... test_05.c ... HIPx ...
   <div class="text"> (</div>
   <div class="data" data-tag="nic-name" data-xpath="/employees/employee/nic-name">"რეგტ"</div>
   <div class="text">)</div>
-  <div class="padding">             </div>
+  <div class="padding">    </div>
   <div class="data" data-tag="last-name" data-xpath="/employees/employee/last-name" data-type="string" data-help="Last name of employee">გთხოვთ ახ     </div>
-  <div class="data" data-tag="department" data-xpath="/employees/employee/department">     431</div>
-  <div class="data" data-tag="percent-time" data-xpath="/employees/employee/percent-time" data-type="number" data-help="Percentage of full &amp; part time (%)">      90</div>
+  <div class="data" data-tag="department" data-xpath="/employees/employee[first-name = 'Jim'][nic-name = '&quot;რეგტ&quot;'][last-name = 'გთხოვთ ახ']/department">     431</div>
+  <div class="data" data-tag="percent-time" data-xpath="/employees/employee[first-name = 'Jim'][nic-name = '&quot;რეგტ&quot;'][last-name = 'გთხოვთ ახ']/percent-time" data-type="number" data-help="Percentage of full &amp; part time (%)">      90</div>
 </div>
 <div class="line">
   <div class="data" data-tag="first-name" data-xpath="/employees/employee/first-name" data-type="string" data-help="First name of employee">Terry</div>
   <div class="text"> (</div>
   <div class="data" data-tag="nic-name" data-xpath="/employees/employee/nic-name">"&lt;one"</div>
   <div class="text">)</div>
-  <div class="padding">           </div>
   <div class="data" data-tag="last-name" data-xpath="/employees/employee/last-name" data-type="string" data-help="Last name of employee">Οὐχὶ ταὐτὰ παρ</div>
-  <div class="data" data-tag="department" data-xpath="/employees/employee/department">     660</div>
-  <div class="data" data-tag="percent-time" data-xpath="/employees/employee/percent-time" data-type="number" data-help="Percentage of full &amp; part time (%)">      90</div>
+  <div class="data" data-tag="department" data-xpath="/employees/employee[first-name = 'Terry'][nic-name = '&quot;&lt;one&quot;'][last-name = 'Οὐχὶ ταὐτὰ παρίσταταί μοι Jones']/department">     660</div>
+  <div class="data" data-tag="percent-time" data-xpath="/employees/employee[first-name = 'Terry'][nic-name = '&quot;&lt;one&quot;'][last-name = 'Οὐχὶ ταὐτὰ παρίσταταί μοι Jones']/percent-time" data-type="number" data-help="Percentage of full &amp; part time (%)">      90</div>

@philshafer philshafer self-assigned this Mar 3, 2024
@philshafer
Copy link
Contributor Author

Running the command:

xohtml -c './test_05.test --libxo:HIPx' -f /tmp/foo.html

while just adding the 'k' to the first field makes it obvious that they length of the key is not being counted:

image

Note that "Terry" is five chars and "Leslie" is six and the second column of the table slides to the left by that amount.

The first two fields are inside a "{[:-25}...{]:}". On the first line ("Jim") the padding

is 3 characters shorter than it should be.

@philshafer
Copy link
Contributor Author

FWIW: tests/core/test_07.c can get the same behavior with the same "{:k}" change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant