fileset-011
Tests contains-regexp, with encoding.
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/encoding">
<p:with-input>
<fileset>
<contains-regexp expression="Copy.* ©"
encoding="ISO-8859-1"/>
</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/encoding/" name="encoding">
<c:file xml:base="iso-8859-1.txt"
name="iso-8859-1.txt"/>
</c:directory>
Filesystem environment
Directory | Perm | Filename | Last-modified | Size | Encoding | Contents (abbreviated) |
---|
compare/a | drwx | | | | | |
| .rwx | four.txt | 2025-01-01T01:01:00Z | 4 |
| four |
| .rwx | one.txt | 2025-01-01T01:01:00Z | 3 |
| one |
| .rwx | three.txt | 2025-01-01T01:01:00Z | 5 |
| three |
| .rwx | two.txt | 2025-01-01T01:01:00Z | 3 |
| two |
compare/b | drwx | | | | | |
| .rwx | one.txt | 2025-01-01T01:01:00Z | 3 |
| one |
| .rwx | three.txt | 2025-01-01T01:01:00Z | 5 |
| THREE |
| .rwx | two.txt | 2025-02-02T01:01:00Z | 3 |
| two |
content-types | drwx | | | | | |
| .rwx | doc.txt |
| 0 |
|
|
| .rwx | doc.xml |
| 0 |
|
|
| .rwx | image.svg |
| 0 |
|
|
| .rwx | pipe.xpl |
| 0 |
|
|
dates/jan | drwx | | | | | |
| .rwx | one.txt | 2025-01-01T01:01:00Z | 3 |
| one |
| .rwx | three.txt | 2025-01-01T01:01:00Z | 9 |
| TWO three |
| .rwx | two.txt | 2025-01-01T01:01:00Z | 7 |
| ONE two |
dates/jun | drwx | | | | | |
| .rwx | one.txt | 2025-06-01T06:01:00Z | 3 |
| one |
| .rwx | three.txt | 2025-06-01T06:01:10Z | 9 |
| TWO three |
| .rwx | two.txt | 2025-06-01T06:01:05Z | 7 |
| ONE two |
encoding | drwx | | | | | |
| .rwx | iso-8859-1.txt |
| 24 | ISO-8859-1 | Copyright © “some date”. |
| .rwx | utf-8.txt |
| 24 |
| Copyright © “some date”. |
| .rwx | utf-8.txt |
| 24 |
| Copyright © “some date”. |
glob/a | drwx | | | | | |
| .rwx | a.txt |
| 0 |
|
|
| .rwx | b.txt |
| 0 |
|
|
| .rwx | c.txt |
| 0 |
|
|
| .rwx | d.txt |
| 0 |
|
|
glob/b | drwx | | | | | |
| .rwx | a.out |
| 0 |
|
|
| .rwx | b.other |
| 0 |
|
|
| .rwx | c.out |
| 0 |
|
|
hier | drwx | | | | | |
| .rwx | one/.git/something |
| 9 |
| something |
| .rwx | one/a.txt |
| 0 |
|
|
| .rwx | one/b.txt |
| 0 |
|
|
| .rwx | one/backup~ |
| 0 |
|
|
| .rwx | one/c.txt |
| 0 |
|
|
| .rwx | one/d.txt |
| 0 |
|
|
| .rwx | one/two/a.txt |
| 0 |
|
|
| .rwx | one/two/b.txt |
| 0 |
|
|
| .rwx | one/two/c.txt |
| 0 |
|
|
| .rwx | one/two/three/a.txt |
| 0 |
|
|
| .rwx | one/two/three/b.txt |
| 0 |
|
|
| .rwx | one/two/three/c.txt |
| 0 |
|
|
| .rwx | one/two/three/d.other |
| 0 |
|
|
hier/one | drwx | | | | | |
| .rwx | .git/something |
| 9 |
| something |
| .rwx | a.txt |
| 0 |
|
|
| .rwx | b.txt |
| 0 |
|
|
| .rwx | backup~ |
| 0 |
|
|
| .rwx | c.txt |
| 0 |
|
|
| .rwx | d.txt |
| 0 |
|
|
| .rwx | two/a.txt |
| 0 |
|
|
| .rwx | two/b.txt |
| 0 |
|
|
| .rwx | two/c.txt |
| 0 |
|
|
| .rwx | two/three/a.txt |
| 0 |
|
|
| .rwx | two/three/b.txt |
| 0 |
|
|
| .rwx | two/three/c.txt |
| 0 |
|
|
| .rwx | two/three/d.other |
| 0 |
|
|
hier/one/.git | drwx | | | | | |
| .rwx | something |
| 9 |
| something |
hier/one/two | drwx | | | | | |
| .rwx | a.txt |
| 0 |
|
|
| .rwx | b.txt |
| 0 |
|
|
| .rwx | c.txt |
| 0 |
|
|
| .rwx | three/a.txt |
| 0 |
|
|
| .rwx | three/b.txt |
| 0 |
|
|
| .rwx | three/c.txt |
| 0 |
|
|
| .rwx | three/d.other |
| 0 |
|
|
hier/one/two/three | drwx | | | | | |
| .rwx | a.txt |
| 0 |
|
|
| .rwx | b.txt |
| 0 |
|
|
| .rwx | c.txt |
| 0 |
|
|
| .rwx | d.other |
| 0 |
|
|
package/input/a/b/c | drwx | | | | | |
| .rwx | d.txt |
| 0 |
|
|
| .rwx | e.txt |
| 0 |
|
|
package/output | drwx | | | | | |
| .rwx | a.b.c.d.html |
| 0 |
|
|
size | drwx | | | | | |
| .rwx | one-hundred.txt |
| 100 |
| 123456789… |
| .rwx | one-thousand.txt |
| 1000 |
| 1234567890123456789012345678901… |
| .rwx | one.txt |
| 1 |
| 1 |
| .rwx | ten-twentyfour.txt |
| 1025 |
| 1234567890123456789012345678901… |
| .rwx | ten.txt |
| 10 |
| 1234567890 |
| .rwx | two.txt |
| 2 |
| 12 |
| .rwx | zero.txt |
| 0 |
|
|
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/encoding/')">The base URI is wrong.</s:assert>
<s:assert test="count(c:file) = 1">Wrong number of files</s:assert>
<s:assert test="c:file[@name = 'iso-8859-1.txt']">The wrong file was selected.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 12 Jun 2025, Norm Tovey-Walsh
- Created test.