fileset-025

Tests the size selector, less h

Test fileset-025.xml is expected to pass.

The pipeline

<p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:p="http://www.w3.org/ns/xproc" 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="5" units="h" when="less"/>
         </fileset>
      </p:with-input>
   </cx:fileset>
</p:declare-step>

Schematron validation

<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" 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) = 5">The number of files is wrong.</s:assert>
         <s:assert test="c:file[@name='zero.txt']">The zero.txt file is missing</s:assert>
         <s:assert test="c:file[@name='one.txt']">The one.txt file is missing</s:assert>
         <s:assert test="c:file[@name='two.txt']">The one.txt file is missing</s:assert>
         <s:assert test="c:file[@name='ten.txt']">The ten.txt file is missing</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.