Files
packages/lang/python/python-pathspec/test.sh
Alexandru Ardelean f5fd23b575 python-pathspec: bump to 1.0.4
Changelog: https://github.com/cpburnz/python-pathspec/blob/master/CHANGELOG.rst

First stable 1.x release with API refinements and bug fixes.
Add test.sh to verify gitignore-style pattern matching.

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
2026-04-09 08:00:48 +03:00

13 lines
387 B
Bash
Executable File

#!/bin/sh
[ "$1" = python3-pathspec ] || exit 0
python3 - << 'EOF'
import pathspec
assert pathspec.__version__, "pathspec version is empty"
spec = pathspec.PathSpec.from_lines("gitwildmatch", ["*.py", "!test_*.py", "build/"])
assert spec.match_file("foo.py")
assert not spec.match_file("test_foo.py")
assert spec.match_file("build/output.txt")
assert not spec.match_file("foo.txt")
EOF