Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: Completion matching control test. (Try 2)



On May 15, 11:04pm, Felix Rosencrantz wrote:
} Subject: PATCH: Completion matching control test. (Try 2)
}
} I would really like to say
}         print -lr "COMPADD:{${match[6]//[\r\n]/}}"
} 
} But we can't use the backslash escape sequences here.

This works for me:

	print -lr "COMPADD:{${match[6]//[$'\r\n']/}}"

Normally $'...' isn't expanded inside double quotes, but because it's
inside an embedded ${...} expansion, the rules get bent.

(I hope that's not a bug.)

} I'd like to see this added even though the test fails.

The failure included below looks like a bug in the matcher code, because
the L spec should cause the string on the line to be retained.  Several
more tests fail for the same reason (I commented out the cleanup/exit in
ZTST_testfailed to force it to run them all).

I suspect the other failed tests are confusion over `*' vs. `**' in the
matcher patterns, but I'm not sure.  For example, the test

Documentation example using "r:|[A-Z0-9]=* r:|=*", input H

works if I change the * to **, and the "input 2" test after it also gives
the right output with ** but fails based on the ending cursor position.

(Does that mean the examples in the doc are out of date?  I haven't looked
yet.)

*** /tmp/zsh.ztst.out.26952     Tue May 16 09:36:58 2000
--- /tmp/zsh.ztst.tout.26952    Tue May 16 09:37:00 2000
***************
*** 1,2 ****
! line: {tst nolistbeep }{}
  COMPADD:{}
--- 1,2 ----
! line: {tst listbeep }{}
  COMPADD:{}
Test ../../zsh-3.1.6/Test/54compmatch.ztst failed: output differs from expected as shown above for:
  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'
Was testing: Documentation example for options, input "nolistbee"
../../zsh-3.1.6/Test/54compmatch.ztst: test failed.


-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author