* Re: PATCH: Completion matching control test.
@ 2000-05-12 11:49 Sven Wischnowsky
0 siblings, 0 replies; 3+ messages in thread
From: Sven Wischnowsky @ 2000-05-12 11:49 UTC (permalink / raw)
To: zsh-workers
Felix Rosencrantz wrote:
> ...
I'll extract the `broken' ones:
1) The option completion thingy, match spec `L:|[nN][oO]= M:_= M:{A-Z}={a-z}':
a) `__N__o__': There are two things to say: we look for [nN]oO] only
at the *beginning*, which it isn't here. Also, we look *only* for
[nN][oO]. Expecting anything else would mean to expect that it
tries all specs and after it succeeds tries the specs again as if
nothing had changed, so that what previously was not the beginning
of the word would now be it.
I haven't looked, but you may find some discussion about this way
back in the archive (1998? 1999?), because it once did this --
although, now that I think of it, it may well be that I never
published that version. By the fact that it was changed you can see
that there were some problems (ugly endless-recusion ones, I
guess). Note also that even if we would allow the change-of-beg-of-word
thing (so that `__no_<TAB>' would work), this still wouldn't work
with `n_o_<TAB>'. For that the code would have to first use match
specs (any number of them) and then go back again and again to try
the other specs. When should it stop?
One way to implement it is to allow users to define some sort of
precedence, i.e. he says that `M:_=' should be tried first and the
other specs work on the result of that. Doesn't sound very friendly
to me either.
Because of all this: I don't think it's broken and hence no patch.
b) `__listbeep__': Yes, the trailing `_'s should be ignored. The patch
below should do that. For that I had to change the test in the main
while-loop in match_str(), probably the only thing that hasn't
changed there yet. I've left a comment there just in case this
turns out to have nasty side-effects.
2) The match spec `m:{a-z}={A-Z}' and matches `ABC Abc abc', doing
`A<TAB>' inserted `Abc'.
Ah, this is a beloved part of the matching system. It wasn't so
stupid to insert the `Abc' match, far from that. It cunningly had a
look at the possible matches `ABC' and `Abc' and at the metch spec
and from that derived that `Abc' is a string that, using the given
match spec, matches both matches. Then it inserted it.
I still like this, unless we have a case like this, where we don't
have an easy way to disambiguate between the matches. So the patch
below has a closer look at the resulting cline list and cuts it in
such cases.
3) The match spec `m:{a-z}={A-Z} r:|[.,_-]=*' and matches
`Abc-Def-Ghij.txt Abc-def.ghi.jkl_mno.pqr.txt
Abc_def_ghi_jkl_mno_pqr.txt', completing `a-d.' considered both
Abc-Def-Ghij.txt and Abc-def.ghi.jkl_mno.pqr.txt to be possible
completions. The first one isn't because there the `*' would match
more than one part. So the patch changes that, but only for `*',
not for `**', obviously. For that there is a cursor-positioning fix
in the patch (I've only uncommented the code that caused it because
we had some problems in that function lately, caused by the new
`**' thing; if I'm not completely mistaken, I just changed the code
in too many places; actually, I'm pretty sure about this, now that
I had a look at it from another angle).
No changes to the test itself because that isn't in the CVS yet and
there is this bit of discussion about the numbering going on.
Bye
Sven
Index: Src/Zle/compmatch.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compmatch.c,v
retrieving revision 1.11
diff -u -r1.11 compmatch.c
--- Src/Zle/compmatch.c 2000/05/08 09:29:22 1.11
+++ Src/Zle/compmatch.c 2000/05/12 11:49:21
@@ -466,7 +466,9 @@
bp->curpos = bc;
bp = bp->next;
}
- while (ll && lw) {
+ /*** This once was: `while (ll && lw)', but then ignored characters at
+ * the end or not, well, ignored. */
+ while (ll) {
/* Hm, we unconditionally first tried the matchers for the cases
* where the beginnings of the line and word patterns match the
@@ -576,7 +578,12 @@
pattern_match(ap, tp - moff, NULL, NULL) &&
(!aol || pattern_match(aop, tp - moff - aol,
NULL, NULL)) &&
- match_parts(l + aoff , tp - moff, alen, part))) {
+ (mp->wlen == -1 ||
+ match_parts(l + aoff , tp - moff,
+ alen, part)))) {
+ if (!both && mp->wlen == -1 &&
+ !match_parts(l + aoff , tp - moff, alen, part))
+ break;
if (sfx) {
savw = tp[-zoff];
tp[-zoff] = '\0';
@@ -1819,13 +1826,19 @@
free_cline(o);
x = o;
o = tn;
+#if 0
+ /*** These should be handled different from the ones
+ that compare anchors. */
if (po && po->prefix && cmp_anchors(x, po, 0)) {
po->flags |= CLF_MISS;
po->max += diff;
} else {
+#endif
o->flags |= CLF_MISS;
o->max += diff;
+#if 0
}
+#endif
continue;
}
}
@@ -1836,13 +1849,19 @@
if (tn && cmp_anchors(o, tn, 0)) {
diff = sub_join(o, n, tn, 0);
+#if 0
+ /*** These should be handled different from the ones
+ that compare anchors. */
if (po && po->prefix && cmp_anchors(n, pn, 0)) {
po->flags |= CLF_MISS;
po->max += diff;
} else {
+#endif
o->flags |= CLF_MISS;
o->max += diff;
+#if 0
}
+#endif
n = tn;
continue;
}
Index: Src/Zle/compresult.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compresult.c,v
retrieving revision 1.13
diff -u -r1.13 compresult.c
--- Src/Zle/compresult.c 2000/04/30 17:58:36 1.13
+++ Src/Zle/compresult.c 2000/05/12 11:49:22
@@ -40,7 +40,7 @@
cut_cline(Cline l)
{
Cline q, p, e = NULL, maxp = NULL;
- int sum = 0, max = 0, tmp, ls = 0;
+ int sum = 0, max = 0, tmp, ls = 0, miss = 0;
/* If no match was added with matching, we don't really know
* which parts of the unambiguous string are worth keeping,
@@ -108,12 +108,39 @@
len += p->max;
if (len > ((minmlen << 1) / 3))
- return l;
+ goto end;
}
e->line = e->word = NULL;
e->llen = e->wlen = e->olen = 0;
e->next = NULL;
}
+ }
+ end:
+
+ /* Sanity check. If there are no parts with missing characters but
+ * parts with joined substrings, remove those. */
+
+ for (p = l, e = 0, tmp = 0; p; p = p->next) {
+ if (p->flags & (CLF_MISS|CLF_DIFF))
+ miss = 1;
+ for (q = p->prefix; q; q = q->next)
+ if (q->flags & CLF_JOIN) {
+ e = p;
+ tmp = 0;
+ break;
+ }
+ for (q = p->suffix; q; q = q->next)
+ if (q->flags & CLF_JOIN) {
+ e = p;
+ tmp = 1;
+ break;
+ }
+ }
+ if (e && (!miss || cline_sublen(e) == e->min)) {
+ for (p = (tmp ? e->suffix : e->prefix);
+ p && p->next && !(p->next->flags & CLF_JOIN); p = p->next);
+ if (p)
+ p->next = NULL;
}
if (!ls)
cline_setlens(l, 0);
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 3+ messages in thread
* PATCH: Completion matching control test.
@ 2000-05-12 4:54 Felix Rosencrantz
2000-05-12 7:54 ` Bart Schaefer
0 siblings, 1 reply; 3+ messages in thread
From: Felix Rosencrantz @ 2000-05-12 4:54 UTC (permalink / raw)
To: zsh-workers
[-- Attachment #1: Type: text/plain, Size: 1501 bytes --]
This patch is a proposed test for completion matching. I was able to
get this test to pass with my latest build of zsh. However, some of the
output struck me as broken and I've included comments saying so. Also,
I'm able to get different results from zsh depending on whether I build
with debugging on or not.
Included in this patch is a change to comptest which allows it to
include any error messages generated by compadd, if it is surrounded by
<COMPADD></COMPADD> markers.
This test seems a bit large compared to other tests, so it may need
some work.
Also, there are tests cases that deal with parsing problems. One
reason, is that I had sort of intended on making the matching spec
error messages a little more explicit about what is wrong. Some of the
messages compadd prints when the matching specs are broken are generic
enough that it wasn't clear to me that my matching spec was broken.
Basically the messages should be clear that a matching spec is broken, since
compadd tends to be several levels removed from the user.
Also, I was interested in performing some code coverage analysis on the
this test with gcov to make sure that as much of the C code is touched. I
haven't done that, though. (Gcov is a GNU code coverage tool.) Maybe
later.
Also, I'm using test 54, to come after the more generic completion test.
.
-FR.
__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/
[-- Attachment #2: allp.txt --]
[-- Type: text/plain, Size: 14329 bytes --]
Index: Test/comptest
===================================================================
--- zsh/Test/,comptest Thu May 11 21:45:35 2000
+++ zsh/Test/comptest Thu May 11 20:52:57 2000
@@ -104,7 +104,7 @@
if [[ "$log" = (#b)*$'<LBUFFER>'(*)$'</LBUFFER>\r\n<RBUFFER>'(*)$'</RBUFFER>'* ]]; then
print -lr "line: {$match[1]}{$match[2]}"
fi
- while (( ${(N)log#*(#b)(<LC><(??)><RC>(*)<EC>|<DESCRIPTION>(*)</DESCRIPTION>|<MESSAGE>(*)</MESSAGE>)} )); do
+ while (( ${(N)log#*(#b)(<LC><(??)><RC>(*)<EC>|<DESCRIPTION>(*)</DESCRIPTION>|<MESSAGE>(*)</MESSAGE>|<COMPADD>(*)</COMPADD>)} )); do
log="${log[$mend[1]+1,-1]}"
if (( 0 <= $mbegin[2] )); then
if [[ $match[2] != TC && $match[3] != \ # ]]; then
@@ -114,6 +114,9 @@
print -lr "DESCRIPTION:{$match[4]}"
elif (( 0 <= $mbegin[5] )); then
print -lr "MESSAGE:{$match[5]}"
+ elif (( 0 <= $mbegin[6] )); then
+ print -lr "COMPADD:{${match[6]//[
+]/}}"
fi
done
done
Index: Test/54compmatch.ztst
===================================================================
--- /dev/null Thu May 11 21:45:14 2000
+++ zsh/Test/54compmatch.ztst Thu May 11 21:44:42 2000
@@ -0,0 +1,463 @@
+# Tests for completion system matching control
+
+#Most test follow this format:
+# test_code $matcher_string selection_list
+# comptest -c "$code" $' tst input_string'
+# test_code generates the string $codem which sets what words the completion
+# should be selecting from. The "comnptest function actually performs the
+# completion test, using the completion function generated by test_code.
+#
+# This test also tests error conditions that compadd reports, so output also
+# contains the compadd output.
+
+%prep
+ zmodload -i zsh/zpty
+
+ TERM=vt100
+ export ZTST_testdir ZTST_srcdir TERM
+ comptest () { $ZTST_testdir/../Src/zsh -f $ZTST_srcdir/comptest -z $ZTST_testdir/../Src/zsh -d $ZTST_testdir/compdump.tmp "$@" }
+
+ mkdir match.tmp
+ cd match.tmp
+
+
+ list1=(IndianRed IndianRed2 IndianRed3 IndianRed4)
+ test_code () {
+ matcher=$1;
+ list=$2;
+ code="compdef _tst tst ; _tst () { echo '<COMPADD>';compadd -M '"
+ code="$code$matcher"
+ code="$code' - ${(P)list} ; echo '</COMPADD>'}"
+ }
+
+
+
+%test
+
+ test_code z: list1
+ comptest -c "$code" $'tst \t'
+0:Match Error for "z:"
+>line: {tst }{}
+>COMPADD:{_tst:compadd: unknown match specification character `z'}
+
+ test_code m: list1
+ comptest -c "$code" $'tst \t'
+0:Match Error for "m:"
+>line: {tst }{}
+>COMPADD:{_tst:compadd: missing patterns}
+
+ test_code M: list1
+ comptest -c "$code" $'tst \t'
+0:Match Error for "M:"
+>line: {tst }{}
+>COMPADD:{_tst:compadd: missing patterns}
+
+ test_code r: list1
+ comptest -c "$code" $'tst \t'
+0:Match Error "r:"
+>line: {tst }{}
+>COMPADD:{_tst:compadd: missing patterns}
+
+ test_code R: list1
+ comptest -c "$code" $'tst \t'
+0:Match Error "R:"
+>line: {tst }{}
+>COMPADD:{_tst:compadd: missing patterns}
+
+ test_code l: list1
+ comptest -c "$code" $'tst \t'
+0:Match Error for "l:"
+>line: {tst }{}
+>COMPADD:{_tst:compadd: missing patterns}
+
+ test_code L: list1
+ comptest -c "$code" $'tst \t'
+0:Match Error for "L:"
+>line: {tst }{}
+>COMPADD:{_tst:compadd: missing patterns}
+
+ test_code 'm:{0-9' list1
+ comptest -c "$code" $'tst \t'
+0:Match Error for "m:{0-9"
+>line: {tst }{}
+>COMPADD:{_tst:compadd: unterminated character class}
+
+ test_code 'm:{0-9}' list1
+ comptest -c "$code" $'tst \t'
+0:Match Error for "m:{0-9}"
+>line: {tst }{}
+>COMPADD:{_tst:compadd: missing word pattern}
+
+ test_code 'm:{0-9}={' list1
+ comptest -c "$code" $'tst \t'
+0:Match Error for "m:{0-9}={"
+>line: {tst }{}
+>COMPADD:{_tst:compadd: unterminated character class}
+
+ test_code 'm:{0-9}={0-' list1
+ comptest -c "$code" $'tst \t'
+0:Match Error for "m:{0-9}={0-"
+>line: {tst }{}
+>COMPADD:{_tst:compadd: unterminated character class}
+
+ test_code 'm:{0-9}={-' list1
+ comptest -c "$code" $'tst \t'
+0:Match Error for "m:{0-9}={-"
+>line: {tst }{}
+>COMPADD:{_tst:compadd: unterminated character class}
+
+ test_code r: list1
+ comptest -c "$code" $'tst \t'
+0:Match Error "r:"
+>line: {tst }{}
+>COMPADD:{_tst:compadd: missing patterns}
+
+ example1_list=(
+ kshoptionprint shglob
+ listambiguous shinstdin
+ listbeep shnullcmd
+ listpacked shoptionletters
+ listrowsfirst shortloops
+ listtypes shwordsplit
+ )
+ options_matcher='L:|[nN][oO]= M:_= M:{A-Z}={a-z}'
+ test_code $options_matcher example1_list
+ comptest -c "$code" $'tst nolistbee\t'
+0:Documentation example for options, input "nolistbee"
+>line: {tst nolistbeep }{}
+>COMPADD:{}
+
+
+ test_code $options_matcher example1_list
+ comptest -c "$code" $'tst list_bee\t'
+0:Documentation example for options, input "list_bee"
+>line: {tst list_beep }{}
+>COMPADD:{}
+
+ test_code $options_matcher example1_list
+ comptest -c "$code" $'tst ListBee\t'
+0:Documentation example for options, input "ListBee"
+>line: {tst ListBeep }{}
+>COMPADD:{}
+
+ test_code $options_matcher example1_list
+ comptest -c "$code" $'tst NOList\tB\t'
+0:Documentation example for options, input "NOList"
+>line: {tst NOList}{}
+>COMPADD:{}
+>NO:{NOListambiguous}
+>NO:{NOListbeep}
+>NO:{NOListpacked}
+>NO:{NOListrowsfirst}
+>NO:{NOListtypes}
+>line: {tst NOListBeep }{}
+>COMPADD:{}
+
+
+ test_code $options_matcher example1_list
+ comptest -c "$code" $'tst NO_List\t__\tB\t'
+0:Documentation example for options, input "NO_List\t__\tB\t"
+>line: {tst NO_List}{}
+>COMPADD:{}
+>NO:{NO_Listambiguous}
+>NO:{NO_Listbeep}
+>NO:{NO_Listpacked}
+>NO:{NO_Listrowsfirst}
+>NO:{NO_Listtypes}
+>line: {tst NO_List__}{}
+>COMPADD:{}
+>NO:{NO_List__ambiguous}
+>NO:{NO_List__beep}
+>NO:{NO_List__packed}
+>NO:{NO_List__rowsfirst}
+>NO:{NO_List__types}
+>line: {tst NO_List__Beep }{}
+>COMPADD:{}
+
+ test_code $options_matcher example1_list
+ comptest -c "$code" $'tst __\tN\t__o\t___\tlist_\tbeep__\t'
+0:Documentation example for options, input "__\tN\t__o\t___\tlist_\tbeep__\t" (broken?)
+>line: {tst __}{}
+>COMPADD:{}
+>NO:{__kshoptionprint}
+>NO:{__listambiguous}
+>NO:{__listbeep}
+>NO:{__listpacked}
+>NO:{__listrowsfirst}
+>NO:{__listtypes}
+>NO:{__shglob}
+>NO:{__shinstdin}
+>NO:{__shnullcmd}
+>NO:{__shoptionletters}
+>NO:{__shortloops}
+>NO:{__shwordsplit}
+>line: {tst __N}{}
+>COMPADD:{}
+>line: {tst __N__o}{}
+>COMPADD:{}
+>line: {tst __N__o___}{}
+>COMPADD:{}
+>line: {tst __N__o___list_}{}
+>COMPADD:{}
+>line: {tst __N__o___list_beep__}{}
+>COMPADD:{}
+
+ test_code $options_matcher example1_list
+ comptest -c "$code" $'tst __\tNo\t___\tlist_\tbeep__\t'
+0:Documentation example for options, input "__\tNo\t___\tlist_\tbeep__\t" (broken?)
+>line: {tst __}{}
+>COMPADD:{}
+>NO:{__kshoptionprint}
+>NO:{__listambiguous}
+>NO:{__listbeep}
+>NO:{__listpacked}
+>NO:{__listrowsfirst}
+>NO:{__listtypes}
+>NO:{__shglob}
+>NO:{__shinstdin}
+>NO:{__shnullcmd}
+>NO:{__shoptionletters}
+>NO:{__shortloops}
+>NO:{__shwordsplit}
+>line: {tst __No}{}
+>COMPADD:{}
+>line: {tst __No___}{}
+>COMPADD:{}
+>line: {tst __No___list_}{}
+>COMPADD:{}
+>line: {tst __No___list_beep__}{}
+>COMPADD:{}
+
+
+ test_code $options_matcher example1_list
+ comptest -c "$code" $'tst ___\tlist_\tbeep__\t'
+0:Documentation example for options, input "___\tlist_\tbeep__\t" (broken?)
+>line: {tst ___}{}
+>COMPADD:{}
+>NO:{___kshoptionprint}
+>NO:{___listambiguous}
+>NO:{___listbeep}
+>NO:{___listpacked}
+>NO:{___listrowsfirst}
+>NO:{___listtypes}
+>NO:{___shglob}
+>NO:{___shinstdin}
+>NO:{___shnullcmd}
+>NO:{___shoptionletters}
+>NO:{___shortloops}
+>NO:{___shwordsplit}
+>line: {tst ___list_}{}
+>COMPADD:{}
+>NO:{___list_ambiguous}
+>NO:{___list_beep}
+>NO:{___list_packed}
+>NO:{___list_rowsfirst}
+>NO:{___list_types}
+>line: {tst ___list_beep__}{}
+>COMPADD:{}
+
+ lower_insensitive_M="M:{a-z}={A-Z}"
+ lower_insensitive_m="m:{a-z}={A-Z}"
+ example2_list=(ABC Abc abc)
+ test_code $lower_insensitive_M example2_list
+ comptest -c "$code" $'tst ab\tC\t'
+0:Documentation example for lowercase insenitive M, input "ab\tC\t"
+>line: {tst ab}{}
+>COMPADD:{}
+>NO:{abC}
+>NO:{abc}
+>line: {tst abC }{}
+>COMPADD:{}
+
+ test_code $lower_insensitive_m example2_list
+ comptest -c "$code" $'tst A\t\t'
+0:Documentation example for lowercase insenitive m, input "A\t\t" (broken?)
+>line: {tst Abc}{}
+>COMPADD:{}
+>line: {tst Abc}{}
+>COMPADD:{}
+>NO:{ABC}
+>NO:{Abc}
+
+ example3_list=(ABC Abc abc)
+ case_insensitive_M="M:{a-zA-Z}={A-Za-z}"
+ case_insensitive_m="m:{a-zA-Z}={A-Za-z}"
+ test_code $case_insensitive_M example3_list
+ comptest -c "$code" $'tst aB\t\t'
+0:Documentation example for case insenitive M, input "aB\t\t"
+>line: {tst aB}{}
+>COMPADD:{}
+>NO:{aBC}
+>NO:{aBc}
+>line: {tst aBC}{}
+>COMPADD:{}
+
+
+ test_code $case_insensitive_m example3_list
+ comptest -c "$code" $'tst aB\t\t'
+0:Documentation example for case insenitive m, input "ab\t\t"
+>line: {tst a}{BC}
+>COMPADD:{}
+>line: {tst a}{BC}
+>COMPADD:{}
+>NO:{ABC}
+>NO:{Abc}
+>NO:{abc}
+
+ example4_matcher='r:|.=* r:|=*'
+ example4_list=(comp.sources.unix comp.sources.misc
+ comp.graphics.algorithms comp.graphics.animation comp.graphics.api
+ comp.graphics.apps comp.graphics.misc comp.graphics.packages
+ comp.graphics.rendering comp.graphics.visualization comp.graphics.apps.alias
+ comp.graphics.apps.gimp comp.graphics.apps.gnuplot
+ comp.graphics.apps.lightwave comp.graphics.apps.pagemaker
+ comp.graphics.apps.paint-shop-pro comp.graphics.apps.photoshop
+ comp.graphics.apps.softimage comp.graphics.apps.ulead
+ comp.graphics.rendering.misc comp.graphics.rendering.raytracing
+ comp.graphics.rendering.renderman)
+ test_code $example4_matcher example4_list
+ comptest -c "$code" $'tst c.s.u\t'
+0:Documentation example using input c.s.u
+>line: {tst comp.sources.unix }{}
+>COMPADD:{}
+
+ test_code $example4_matcher example4_list
+ comptest -c "$code" $'tst c.g.\ta\t.\tp\ta\tg\t'
+0:Documentation example using input c.g.\ta\t.\tp\ta\tg\t
+>line: {tst comp.graphics.}{}
+>COMPADD:{}
+>line: {tst comp.graphics.a}{}
+>COMPADD:{}
+>NO:{comp.graphics.algorithms}
+>NO:{comp.graphics.animation}
+>NO:{comp.graphics.api}
+>NO:{comp.graphics.apps}
+>NO:{comp.graphics.apps.alias}
+>NO:{comp.graphics.apps.gimp}
+>NO:{comp.graphics.apps.gnuplot}
+>NO:{comp.graphics.apps.lightwave}
+>NO:{comp.graphics.apps.pagemaker}
+>NO:{comp.graphics.apps.paint-shop-pro}
+>NO:{comp.graphics.apps.photoshop}
+>NO:{comp.graphics.apps.softimage}
+>NO:{comp.graphics.apps.ulead}
+>line: {tst comp.graphics.apps.}{}
+>COMPADD:{}
+>line: {tst comp.graphics.apps.p}{}
+>COMPADD:{}
+>NO:{comp.graphics.apps.pagemaker}
+>NO:{comp.graphics.apps.paint-shop-pro}
+>NO:{comp.graphics.apps.photoshop}
+>line: {tst comp.graphics.apps.pa}{}
+>COMPADD:{}
+>NO:{comp.graphics.apps.pagemaker}
+>NO:{comp.graphics.apps.paint-shop-pro}
+>line: {tst comp.graphics.apps.pagemaker }{}
+>COMPADD:{}
+
+ test_code $example4_matcher example4_list
+ comptest -c "$code" $'tst c...pag\t'
+0:Documentation example using input c...pag\t
+>line: {tst comp.graphics.apps.pagemaker }{}
+>COMPADD:{}
+
+ test_code $example4_matcher example4_list
+ comptest -c "$code" $'tst c...pa\tg\t'
+0:Documentation example using input c...pa\tg\t
+>line: {tst comp.graphics.apps.pa}{}
+>COMPADD:{}
+>line: {tst comp.graphics.apps.pagemaker }{}
+>COMPADD:{}
+
+ example5_matcher='r:|[.,_-]=* r:|=*'
+ example5_list=(veryverylongfile.c veryverylongheader.h)
+ test_code $example5_matcher example5_list
+ comptest -c "$code" $'tst v.c\tv.h\t'
+0:Documentation example using input v.c\t
+>line: {tst veryverylongfile.c }{}
+>COMPADD:{}
+>line: {tst veryverylongfile.c veryverylongheader.h }{}
+>COMPADD:{}
+
+
+ example6_list=(LikeTHIS FooHoo foo123 bar234)
+ test_code 'r:|[A-Z0-9]=* r:|=*' example6_list
+ comptest -c "$code" $'tst H\t'
+0:Documentation example using "r:|[A-Z0-9]=* r:|=*", input H
+>line: {tst }{H}
+>COMPADD:{}
+>NO:{FooHoo}
+>NO:{LikeTHIS}
+
+ test_code 'r:|[A-Z0-9]=* r:|=*' example6_list
+ comptest -c "$code" $'tst 2\t\t'
+0:Documentation example using "r:|[A-Z0-9]=* r:|=*", input 2
+>line: {tst }{23}
+>COMPADD:{}
+>line: {tst }{23}
+>COMPADD:{}
+>NO:{bar234}
+>NO:{foo123}
+
+ example7_matcher="r:[^A-Z0-9]||[A-Z0-9]=* r:|=*"
+ example7_list=($example6_list)
+ test_code $example7_matcher example7_list
+ comptest -c "$code" $'tst H\t2\t'
+0:Documentation example using "r:[^A-Z0-9]||[A-Z0-9]=* r:|=*"
+>line: {tst FooHoo }{}
+>COMPADD:{}
+>line: {tst FooHoo bar234 }{}
+>COMPADD:{}
+
+
+
+ workers_7311_matcher="m:{a-z}={A-Z} r:|[.,_-]=*"
+ workers_7311_list=(Abc-Def-Ghij.txt Abc-def.ghi.jkl_mno.pqr.txt Abc_def_ghi_jkl_mno_pqr.txt)
+ test_code $workers_7311_matcher workers_7311_list
+ comptest -c "$code" $'tst a-a\t'
+0:Bug from workers 7311
+>line: {tst a-a}{}
+>COMPADD:{}
+
+ test_code $workers_7311_matcher workers_7311_list
+ comptest -c "$code" $'tst a\t\t-d.\t'
+0:Bug from workers_7311 (broken?)
+>line: {tst Abc}{}
+>COMPADD:{}
+>line: {tst Abc}{}
+>COMPADD:{}
+>NO:{Abc-Def-Ghij.txt}
+>NO:{Abc-def.ghi.jkl_mno.pqr.txt}
+>NO:{Abc_def_ghi_jkl_mno_pqr.txt}
+>line: {tst Abc}{-def.txt}
+>COMPADD:{}
+
+ workers_10886_matcher="r:|[A-Z0-9]=*"
+ workers_10886_list=(BW UWB W)
+ test_code $workers_10886_matcher workers_10886_list
+ comptest -c "$code" $'tst W\t'
+0:Bug from workers 10886
+>line: {tst }{W}
+>COMPADD:{}
+>NO:{BW}
+>NO:{UWB}
+>NO:{W}
+
+ workers_11081_matcher='m:{a-zA-Z}={A-Za-z} r:|[.,_-]=* r:[^A-Z0-9]||[A-Z0-9]=* r:[A-Z0-9]||[^A-Z0-9]=* r:[^0-9]||[0-9]=*'
+ workers_11081_list=(build.out build.out1 build.out2)
+ test_code $workers_11081_matcher workers_11081_list
+ comptest -c "$code" $'tst bui\t\t\t'
+0:Bug from workers 11081
+>line: {tst build.out}{}
+>COMPADD:{}
+>line: {tst build.out}{}
+>COMPADD:{}
+>NO:{build.out}
+>NO:{build.out1}
+>NO:{build.out2}
+>line: {tst build.out}{}
+>COMPADD:{}
+
+
+%clean
+exit 0
Index: Test/.distfiles
===================================================================
--- zsh/Test/,.distfiles Wed Apr 19 12:03:09 2000
+++ zsh/Test/.distfiles Thu May 11 21:44:19 2000
@@ -5,5 +5,5 @@
05command.ztst 06arith.ztst 07cond.ztst 08traps.ztst 09funcdef.ztst
10prompt.ztst 11glob.ztst 12procsubst.ztst 13parameter.ztst
50cd.ztst 51xtrace.ztst 52zregexparse.ztst
- 53completion.ztst
+ 53completion.ztst 54compmatch.ztst
'
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PATCH: Completion matching control test.
2000-05-12 4:54 Felix Rosencrantz
@ 2000-05-12 7:54 ` Bart Schaefer
0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2000-05-12 7:54 UTC (permalink / raw)
To: zsh-workers
On May 11, 9:54pm, Felix Rosencrantz wrote:
} Subject: PATCH: Completion matching control test.
}
} This patch is a proposed test for completion matching. I was able to
} get this test to pass with my latest build of zsh.
The test fails for me with the following output; I had to capture this
with "make check >& file" because of the four carriage-returns in the
last line of the diff:
*** /tmp/zsh.ztst.out.4987 Fri May 12 00:27:35 2000
--- /tmp/zsh.ztst.tout.4987 Fri May 12 00:27:40 2000
***************
*** 1,2 ****
line: {tst }{}
! COMPADD:{_tst:compadd: unknown match specification character `z'}
--- 1,2 ----
line: {tst }{}
! COMPADD:{\r\r\r_tst:compadd: unknown match specification character `z'\r}
Test ../../zsh-3.1.6/Test/54compmatch.ztst failed: output differs from expected as shown above for:
test_code z: list1
comptest -c "$code" $'tst \t'
Was testing: Match Error for "z:"
../../zsh-3.1.6/Test/54compmatch.ztst: test failed.
} Also, I'm using test 54, to come after the more generic completion test.
I suppose that makes sense, but we've been talking about renumbering all
the tests above 50 ...
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2000-05-12 11:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-12 11:49 PATCH: Completion matching control test Sven Wischnowsky
-- strict thread matches above, loose matches on Subject: below --
2000-05-12 4:54 Felix Rosencrantz
2000-05-12 7:54 ` Bart Schaefer
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).