fileset-022

Tests the size selector, equal h

Test is expected to pass.

The pipeline

<p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions"
                xmlns:p="http://www.w3.org/ns/xproc"
                xmlns:t="http://xproc.org/ns/testsuite/3.0" name="main" version="3.0">
   <p:import href="https://xmlcalabash.com/ext/library/fileset.xpl"/>
   <p:output port="result" sequence="true"/>
   <cx:fileset path="../testfolder/size">
      <p:with-input>
         <fileset>
            <size value="1" units="h"/>
         </fileset>
      </p:with-input>
   </cx:fileset>
</p:declare-step>

Result

<c:directory xmlns:c="http://www.w3.org/ns/xproc-step"
             xmlns:t="http://xproc.org/ns/testsuite/3.0"
             xml:base="file:///woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/extra-suite/test-suite/testfolder/size/" name="size">
   <c:file xml:base="one-hundred.txt"
           name="one-hundred.txt"/>
</c:directory>

Filesystem environment

DirectoryPermFilenameLast-modifiedSizeEncodingContents (abbreviated)
compare/adrwx
  .rwxfour.txt2025-01-01T01:01:00Z4four
  .rwxone.txt2025-01-01T01:01:00Z3one
  .rwxthree.txt2025-01-01T01:01:00Z5three
  .rwxtwo.txt2025-01-01T01:01:00Z3two
compare/bdrwx
  .rwxone.txt2025-01-01T01:01:00Z3one
  .rwxthree.txt2025-01-01T01:01:00Z5THREE
  .rwxtwo.txt2025-02-02T01:01:00Z3two
content-typesdrwx
  .rwxdoc.txt0
  .rwxdoc.xml0
  .rwximage.svg0
  .rwxpipe.xpl0
dates/jandrwx
  .rwxone.txt2025-01-01T01:01:00Z3one
  .rwxthree.txt2025-01-01T01:01:00Z9TWO three
  .rwxtwo.txt2025-01-01T01:01:00Z7ONE two
dates/jundrwx
  .rwxone.txt2025-06-01T06:01:00Z3one
  .rwxthree.txt2025-06-01T06:01:10Z9TWO three
  .rwxtwo.txt2025-06-01T06:01:05Z7ONE two
encodingdrwx
  .rwxiso-8859-1.txt24ISO-8859-1Copyright © “some date”.
  .rwxutf-8.txt24Copyright © “some date”.
  .rwxutf-8.txt24Copyright © “some date”.
glob/adrwx
  .rwxa.txt0
  .rwxb.txt0
  .rwxc.txt0
  .rwxd.txt0
glob/bdrwx
  .rwxa.out0
  .rwxb.other0
  .rwxc.out0
hierdrwx
  .rwxone/.git/something9something
  .rwxone/a.txt0
  .rwxone/b.txt0
  .rwxone/backup~0
  .rwxone/c.txt0
  .rwxone/d.txt0
  .rwxone/two/a.txt0
  .rwxone/two/b.txt0
  .rwxone/two/c.txt0
  .rwxone/two/three/a.txt0
  .rwxone/two/three/b.txt0
  .rwxone/two/three/c.txt0
  .rwxone/two/three/d.other0
hier/onedrwx
  .rwx.git/something9something
  .rwxa.txt0
  .rwxb.txt0
  .rwxbackup~0
  .rwxc.txt0
  .rwxd.txt0
  .rwxtwo/a.txt0
  .rwxtwo/b.txt0
  .rwxtwo/c.txt0
  .rwxtwo/three/a.txt0
  .rwxtwo/three/b.txt0
  .rwxtwo/three/c.txt0
  .rwxtwo/three/d.other0
hier/one/.gitdrwx
  .rwxsomething9something
hier/one/twodrwx
  .rwxa.txt0
  .rwxb.txt0
  .rwxc.txt0
  .rwxthree/a.txt0
  .rwxthree/b.txt0
  .rwxthree/c.txt0
  .rwxthree/d.other0
hier/one/two/threedrwx
  .rwxa.txt0
  .rwxb.txt0
  .rwxc.txt0
  .rwxd.other0
package/input/a/b/cdrwx
  .rwxd.txt0
  .rwxe.txt0
package/outputdrwx
  .rwxa.b.c.d.html0
sizedrwx
  .rwxone-hundred.txt100123456789…
  .rwxone-thousand.txt10001234567890123456789012345678901…
  .rwxone.txt11
  .rwxten-twentyfour.txt10251234567890123456789012345678901…
  .rwxten.txt101234567890
  .rwxtwo.txt212
  .rwxzero.txt0

Schematron checks

<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron"
          xmlns:t="http://xproc.org/ns/testsuite/3.0" queryBinding="xslt2">
   <s:ns prefix="c"
         uri="http://www.w3.org/ns/xproc-step"/>
   <s:pattern>
      <s:rule context="/">
         <s:assert test="c:directory">The root is wrong.</s:assert>
      </s:rule>
   </s:pattern>
   <s:pattern>
      <s:rule context="/c:directory">
         <s:assert test="ends-with(@xml:base, '/testfolder/size/')">The base URI is wrong.</s:assert>
         <s:assert test="count(c:file) = 1">The number of files is wrong.</s:assert>
         <s:assert test="c:file[@name='one-hundred.txt']">The one-hundred.txt file is missing</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

12 Jun 2025, Norm Tovey-Walsh
Created test.