Subject: Developers of Sympa
List archive
- From: Marc Chantreux <address@concealed>
- To: address@concealed
- Subject: [sympa-developpers] any clue about that regexp ?
- Date: Wed, 26 Sep 2018 17:30:10 +0200
Hello,
we arbitrary started to refactor some code from
Bulk and Spool so i got to figure out what the old one
do ... while there is no test, no doc, no comment, no
explaination whatsoever in some parts of the code.
I'm on my way to make Sympa::Spool::build_glob_pattern
more maintainable (adding some test, some type checking and
rearange the code a little bit).
Soji: it would be great if you add a test suite to this
function so we can figure out what to expect from it
Also. i found this (line 302)
s/(%%|%[-#+.\d ]*[l]*\w)/$1 eq '%%' ? '%%' : '%s'/reg
and my brain converted the first alternative by:
replace '%%' by '%%'
so i want to rewrite this way
s{ % [-#+.\d ]* [l]* \w }{%s}rgx
but ... that couldn't be so easy? is it? I write the test suite
below but Soji: can you explain what you write the sub this way?
regards,
marc
use Sympatic;
use Test::More;
map {
my ( $soji, $marc ) = map {
s/(%%|%[-#+.\d ]*[l]*\w)/$1 eq '%%' ? '%%' : '%s'/reg
, s{ % [-#+.\d ]* [l]* \w }{%s}rgx
} $_;
is $soji, $marc, "soji and marc agreed for $_";
}
'%s.%s.%d.%f.%s@%s_%s,%ld,%d/%s'
, '%%%s'
, '%s%%s'
, '%-[]ld%%s'
;
done_testing;
-
[sympa-developpers] any clue about that regexp ?,
Marc Chantreux, 09/26/2018
-
Re: [sympa-developpers] any clue about that regexp ?,
IKEDA Soji, 09/27/2018
- Re: [sympa-developpers] any clue about that regexp ?, Marc Chantreux, 09/27/2018
-
Re: [sympa-developpers] any clue about that regexp ?,
David Verdin, 09/27/2018
-
Re: [sympa-developpers] any clue about that regexp ?,
Stefan Hornburg (Racke), 09/27/2018
-
Re: [sympa-developpers] any clue about that regexp ?,
David Verdin, 09/27/2018
- Re: [sympa-developpers] any clue about that regexp ?, Marc Chantreux, 09/27/2018
-
Re: [sympa-developpers] any clue about that regexp ?,
David Verdin, 09/27/2018
-
Re: [sympa-developpers] any clue about that regexp ?,
Stefan Hornburg (Racke), 09/27/2018
-
Re: [sympa-developpers] any clue about that regexp ?,
Soji Ikeda, 09/27/2018
-
Re: [sympa-developpers] any clue about that regexp ?,
Marc Chantreux, 09/27/2018
- Re: [sympa-developpers] any clue about that regexp ?, Soji Ikeda, 09/27/2018
-
Re: [sympa-developpers] any clue about that regexp ?,
Marc Chantreux, 09/27/2018
-
Re: [sympa-developpers] any clue about that regexp ?,
IKEDA Soji, 09/27/2018
Archive powered by MHonArc 2.6.19+.