aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/common/.zsh/modules/Test/V07pcre.ztst
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-02 12:16:38 -0500
committerCraig Jennings <c@cjennings.net>2026-06-02 12:16:38 -0500
commit8c32bbbf9fab115dc51afa17c081e0763cbee717 (patch)
tree246b46b53c956cfea07bc9d1c2b81f9f8de53d65 /dotfiles/common/.zsh/modules/Test/V07pcre.ztst
parent3f370d6c19c83430547d1771b0e6fa669dc7d5c5 (diff)
downloadarchsetup-8c32bbbf9fab115dc51afa17c081e0763cbee717.tar.gz
archsetup-8c32bbbf9fab115dc51afa17c081e0763cbee717.zip
refactor: drop in-repo dotfiles/, move stow tooling to the dotfiles repo
Since the installer clones DOTFILES_REPO into ~/.dotfiles and stows from there, the in-repo dotfiles/ tree was dead weight. Nothing reads it at install time. I removed it (831 files) now that both machines are migrated. The Makefile's stow / restow / reset / unstow / import targets and the dotfile-script unit suites moved to the dotfiles repo. They sit alongside the scripts they manage and run standalone (cd ~/.dotfiles && make ...). This Makefile keeps the VM-integration targets and the installer-helper suite (safe-rm-rf). I updated CLAUDE.md and README.md so stow operations run from ~/.dotfiles, and the dotfile-management, theme, and unit-test sections point at the standalone repo. The README was already describing the old in-repo model from before the installer switched to cloning. This brings it in line.
Diffstat (limited to 'dotfiles/common/.zsh/modules/Test/V07pcre.ztst')
-rw-r--r--dotfiles/common/.zsh/modules/Test/V07pcre.ztst139
1 files changed, 0 insertions, 139 deletions
diff --git a/dotfiles/common/.zsh/modules/Test/V07pcre.ztst b/dotfiles/common/.zsh/modules/Test/V07pcre.ztst
deleted file mode 100644
index ad17707..0000000
--- a/dotfiles/common/.zsh/modules/Test/V07pcre.ztst
+++ /dev/null
@@ -1,139 +0,0 @@
-%prep
-
- if ! zmodload -F zsh/pcre C:pcre-match 2>/dev/null
- then
- ZTST_unimplemented="the zsh/pcre module is not available"
- return 0
- fi
-# Load the rest of the builtins
- zmodload zsh/pcre
- setopt rematch_pcre
-# Find a UTF-8 locale.
- setopt multibyte
-# Don't let LC_* override our choice of locale.
- unset -m LC_\*
- mb_ok=
- langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8
- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8'))
- for LANG in $langs; do
- if [[ é = ? ]]; then
- mb_ok=1
- break;
- fi
- done
- if [[ -z $mb_ok ]]; then
- ZTST_unimplemented="no UTF-8 locale or multibyte mode is not implemented"
- else
- print -u $ZTST_fd Testing PCRE multibyte with locale $LANG
- mkdir multibyte.tmp && cd multibyte.tmp
- fi
-
-%test
-
- [[ 'foo→bar' =~ .([^[:ascii:]]). ]]
- print $MATCH
- print $match[1]
-0:Basic non-ASCII regexp matching
->o→b
->→
-
- unset match mend
- s=$'\u00a0'
- [[ $s =~ '^.$' ]] && print OK
- [[ A${s}B =~ .(.). && $match[1] == $s ]] && print OK
- [[ A${s}${s}B =~ A([^[:ascii:]]*)B && $mend[1] == 3 ]] && print OK
- unset s
-0:Raw IMETA characters in input string
->OK
->OK
->OK
-
- [[ foo =~ f.+ ]] ; print $?
- [[ foo =~ x.+ ]] ; print $?
- [[ ! foo =~ f.+ ]] ; print $?
- [[ ! foo =~ x.+ ]] ; print $?
- [[ foo =~ f.+ && bar =~ b.+ ]] ; print $?
- [[ foo =~ x.+ && bar =~ b.+ ]] ; print $?
- [[ foo =~ f.+ && bar =~ x.+ ]] ; print $?
- [[ ! foo =~ f.+ && bar =~ b.+ ]] ; print $?
- [[ foo =~ f.+ && ! bar =~ b.+ ]] ; print $?
- [[ ! ( foo =~ f.+ && bar =~ b.+ ) ]] ; print $?
- [[ ! foo =~ x.+ && bar =~ b.+ ]] ; print $?
- [[ foo =~ x.+ && ! bar =~ b.+ ]] ; print $?
- [[ ! ( foo =~ x.+ && bar =~ b.+ ) ]] ; print $?
-0:Regex result inversion detection
->0
->1
->1
->0
->0
->1
->1
->1
->1
->1
->0
->1
->0
-
-# Note that PCRE_ANCHORED only means anchored at the start
-# Also note that we don't unset MATCH/match on failed match (and it's an
-# open issue as to whether or not we should)
- pcre_compile '.(→.)'
- pcre_match foo→bar
- print $? $MATCH $match ; unset MATCH match
- pcre_match foo.bar
- print $? $MATCH $match ; unset MATCH match
- pcre_match foo†bar
- print $? $MATCH $match ; unset MATCH match
- pcre_match foo→†ar
- print $? $MATCH $match ; unset MATCH match
- pcre_study
- pcre_match foo→bar
- print $? $MATCH $match ; unset MATCH match
- pcre_compile -a '.(→.)'
- pcre_match foo→bar
- print $? $MATCH $match ; unset MATCH match
- pcre_match o→bar
- print $? $MATCH $match ; unset MATCH match
- pcre_match o→b
- print $? $MATCH $match ; unset MATCH match
- pcre_compile 'x.(→.)'
- pcre_match xo→t
- print $? $MATCH $match ; unset MATCH match
- pcre_match Xo→t
- print $? $MATCH $match ; unset MATCH match
- pcre_compile -i 'x.(→.)'
- pcre_match xo→t
- print $? $MATCH $match ; unset MATCH match
- pcre_match Xo→t
- print $? $MATCH $match ; unset MATCH match
-0:pcre_compile interface testing: basic, anchored & case-insensitive
->0 o→b →b
->1
->1
->0 o→† →†
->0 o→b →b
->1
->0 o→b →b
->0 o→b →b
->0 xo→t →t
->1
->0 xo→t →t
->0 Xo→t →t
-
- string="The following zip codes: 78884 90210 99513"
- pcre_compile -m "\d{5}"
- pcre_match -b -- $string && print "$MATCH; ZPCRE_OP: $ZPCRE_OP"
- pcre_match -b -n $ZPCRE_OP[(w)2] -- $string || print failed
- print "$MATCH; ZPCRE_OP: $ZPCRE_OP"
-0:pcre_match -b and pcre_match -n
->78884; ZPCRE_OP: 25 30
->90210; ZPCRE_OP: 31 36
-
-# Subshell because crash on failure
- ( setopt re_match_pcre
- [[ test.txt =~ '^(.*_)?(test)' ]]
- echo $match[2] )
-0:regression for segmentation fault, workers/38307
->test