From: Marlon Richert <marlon.richert@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Cc: Oliver Kiddle <opk@zsh.org>, Bart Schaefer <schaefer@brasslantern.com>
Subject: [RFC] Add xfail tests for || form of completion matchers
Date: Mon, 11 Oct 2021 17:34:28 +0300 [thread overview]
Message-ID: <CAHLkEDvf+tX1U5V0Ap6HnSGyBiARJ_U35ry_6jBH9TqVhyft+A@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 170 bytes --]
The tests show how :||= matchers should behave in order to provide
completion features that cannot be implemented with :|= matchers.
This is a follow-up to users/27228.
[-- Attachment #2: 0001-Add-xfail-tests-for-form-of-completion-matchers.txt --]
[-- Type: text/plain, Size: 5113 bytes --]
From 8640592169e90c89fd879baf39274f4a6a5822ee Mon Sep 17 00:00:00 2001
From: Marlon Richert <marlon.richert@gmail.com>
Date: Mon, 11 Oct 2021 17:30:07 +0300
Subject: [PATCH] Add xfail tests for || form of completion matchers
The tests show how :||= matchers should behave in order to provide
completion features that cannot be implemented with :|= matchers.
---
Test/Y02compmatch.ztst | 108 +++++++++++++++++++++++++++++++++++++----
1 file changed, 98 insertions(+), 10 deletions(-)
diff --git a/Test/Y02compmatch.ztst b/Test/Y02compmatch.ztst
index 621707482..ee7e422c1 100644
--- a/Test/Y02compmatch.ztst
+++ b/Test/Y02compmatch.ztst
@@ -378,15 +378,26 @@
comp.graphics.rendering.misc comp.graphics.rendering.raytracing
comp.graphics.rendering.renderman)
test_code $example4_matcher example4_list
- comptest $'tst c.s.u\t'
-0:Documentation example using input c.s.u
+ comptest $'tst .s.u\t'
+0:Documentation example using input .s.u
+>line: {tst comp.sources.unix }{}
+>COMPADD:{}
+>INSERT_POSITIONS:{21}
+
+ example4b_matcher='r:[^.]||.=* r:|=*'
+ test_code $example4b_matcher example4_list
+ comptest $'tst .s.u\t^[bc\t'
+0f:Documentation example using input .s.u but with double anchor
+>line: {tst .s.u}{}
+>COMPADD:{}
+>INSERT_POSITIONS:{}
>line: {tst comp.sources.unix }{}
>COMPADD:{}
>INSERT_POSITIONS:{21}
test_code $example4_matcher example4_list
- comptest $'tst c.g.\ta\t.\tp\ta\tg\t'
-0:Documentation example using input c.g.\ta\t.\tp\ta\tg\t
+ comptest $'tst .g.\ta\t.\tp\ta\tg\t'
+0:Documentation example using input .g.\ta\t.\tp\ta\tg\t
>line: {tst comp.graphics.}{}
>COMPADD:{}
>INSERT_POSITIONS:{18}
@@ -424,9 +435,32 @@
>COMPADD:{}
>INSERT_POSITIONS:{32}
+ test_code $example4b_matcher example4_list
+ comptest $'tst .g.\t^[bc\t'
+0f:Documentation example using input .g. with double anchor
+>line: {tst .g.}{}
+>COMPADD:{}
+>INSERT_POSITIONS:{}
+>line: {tst comp.graphics.}{}
+>COMPADD:{}
+>INSERT_POSITIONS:{18}
+
test_code $example4_matcher example4_list
- comptest $'tst c...pag\t'
-0:Documentation example using input c...pag\t
+ comptest $'tst ...pag\t'
+0:Documentation example using input ...pag
+>line: {tst comp.graphics.apps.pagemaker }{}
+>COMPADD:{}
+>INSERT_POSITIONS:{32}
+
+ test_code $example4b_matcher example4_list
+ comptest $'tst ...pag\t^[bc\t^Fg^F^Fa\t'
+0f:Documentation example using input ...pag with double anchor
+>line: {tst .g.}{}
+>COMPADD:{}
+>INSERT_POSITIONS:{}
+>line: {tst c...pag}{}
+>COMPADD:{}
+>INSERT_POSITIONS:{}
>line: {tst comp.graphics.apps.pagemaker }{}
>COMPADD:{}
>INSERT_POSITIONS:{32}
@@ -444,8 +478,8 @@
example5_matcher='r:|[.,_-]=* r:|=*'
example5_list=(veryverylongfile.c veryverylongheader.h)
test_code $example5_matcher example5_list
- comptest $'tst v.c\tv.h\t'
-0:Documentation example using input v.c\t
+ comptest $'tst .c\t.h\t'
+0:Documentation example using input .c
>line: {tst veryverylongfile.c }{}
>COMPADD:{}
>INSERT_POSITIONS:{23}
@@ -453,6 +487,23 @@
>COMPADD:{}
>INSERT_POSITIONS:{44}
+ example5b_matcher='r:[^.,_-]||[.,_-]=* r:|=*'
+ test_code $example5b_matcher example5_list
+ comptest $'tst .c\t^[bv\t.h\t^[bv'
+0f:Documentation example using input .c but with double anchor
+>line: {tst .c}{}
+>COMPADD:{}
+>INSERT_POSITIONS:{}
+>line: {tst veryverylongfile.c }{}
+>COMPADD:{}
+>INSERT_POSITIONS:{23}
+>line: {tst veryverylongfile.c .h}{}
+>COMPADD:{}
+>INSERT_POSITIONS:{}
+>line: {tst veryverylongfile.c veryverylongheader.h }{}
+>COMPADD:{}
+>INSERT_POSITIONS:{44}
+
example6_list=(LikeTHIS FooHoo 5foo123 5bar234)
test_code 'r:|[A-Z0-9]=* r:|=*' example6_list
@@ -493,15 +544,52 @@
example7_matcher="r:[^A-Z0-9]||[A-Z0-9]=** r:|=*"
example7_list=($example6_list)
test_code $example7_matcher example7_list
- comptest $'tst H\t2\t'
-0:Documentation example using "r:[^A-Z0-9]||[A-Z0-9]=** r:|=*"
+ comptest $'tst H\t^[bF\to2\t^[b5\tb\t'
+0f:Documentation example using "r:[^A-Z0-9]||[A-Z0-9]=** r:|=*"
+>line: {tst H}{}
+>COMPADD:{}
+>INSERT_POSITIONS:{}
+>line: {tst F}{H}
+>COMPADD:{}
+>INSERT_POSITIONS:{}
>line: {tst FooHoo }{}
>COMPADD:{}
>INSERT_POSITIONS:{10}
+>line: {tst FooHoo 2}{}
+>COMPADD:{}
+>INSERT_POSITIONS:{}
+>line: {tst FooHoo 5}{2}
+>COMPADD:{}
+>INSERT_POSITIONS:{}
>line: {tst FooHoo 5bar234 }{}
>COMPADD:{}
>INSERT_POSITIONS:{18}
+ example7b_matcher="r:?||[A-Z0-9]=* r:|=*"
+ test_code $example7b_matcher example7_list
+ comptest $'tst H\t^[bF2\t^[b5\t'
+0f:Documentation example using "r:?||[A-Z0-9]=* r:|=*"
+>line: {tst H}{}
+>COMPADD:{}
+>INSERT_POSITIONS:{}
+>line: {tst FooHoo }{}
+>COMPADD:{}
+>INSERT_POSITIONS:{10}
+>line: {tst FooHoo 5bar234 }{}
+>COMPADD:{}
+>INSERT_POSITIONS:{18}
+
+ example8_list=(passwd.byname)
+ test_code 'r:[^.]||.=* l:.||[^.]=*'
+ comptest $'tst .^B\tpass^Fname\t'
+0f:Symmetry between r and l
+>line: {tst }{.}
+>COMPADD:{}
+>INSERT_POSITIONS:{}
+>line: {tst passwd.byname }{}
+>COMPADD:{}
+>INSERT_POSITIONS:{17}
+
workers_7311_matcher="m:{a-z}={A-Z} r:|[.,_-]=* r:|=*"
workers_7311_list=(Abc-Def-Ghij.txt Abc-def.ghi.jkl_mno.pqr.txt Abc_def_ghi_jkl_mno_pqr.txt)
--
2.33.0
next reply other threads:[~2021-10-11 14:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-11 14:34 Marlon Richert [this message]
2021-10-12 12:08 ` Marlon Richert
2021-10-12 15:25 ` Daniel Shahaf
2021-10-13 4:57 ` Bart Schaefer
2021-10-13 5:08 ` Bart Schaefer
2021-10-13 14:20 ` Marlon Richert
2021-10-13 19:37 ` Daniel Shahaf
2021-10-13 20:02 ` Bart Schaefer
2021-10-14 20:25 ` Oliver Kiddle
2021-10-14 20:43 ` Oliver Kiddle
2021-10-14 21:16 ` Bart Schaefer
2021-10-22 13:02 ` Oliver Kiddle
2021-10-25 18:41 ` Marlon Richert
2021-10-25 19:41 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHLkEDvf+tX1U5V0Ap6HnSGyBiARJ_U35ry_6jBH9TqVhyft+A@mail.gmail.com \
--to=marlon.richert@gmail.com \
--cc=opk@zsh.org \
--cc=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).