[sf-perl] regex problem: append path only if not in list already

David Christensen dpchrist at holgerdanske.com
Sun Mar 14 20:46:05 PDT 2021


sfpm:

I put some more time into Lambert's regular expression problem.  Please 
see the attached tarball.


You can exercise the existing solutions and test cases via 'make':

$ make
...

$ make help
Available make(1) targets:
   all            run test cases for all solutions
   clean          remove generated test files
   dist           create a distribution tarball
   help           print this message


You can add solutions as follows:

1.  Create an executable program or script in the working directory. 
The solution should accept one argument -- the name of a sudoers(5) file 
to be processed -- and should print the original or modified file 
contents to standard output:

2021-03-14 20:36:22 dpchrist at tinkywinky ~/sandbox/perl/sudoers-secure_path
$ ./dpchrist.pl sudoers.0.in
...

2.  Invoke the program 'testscript.t' and provide the name of your 
solution program or script as the argument.  This will feed the various 
test cases to the solution and check the results:

2021-03-14 20:36:15 dpchrist at tinkywinky ~/sandbox/perl/sudoers-secure_path
$ ./testscript.t dpchrist.pl
...

3.  Add the name of the program or script to the 'solutions' text file 
to integrate the solution into the Makefile.


You can add test cases as follows:

1.  Create sudoers.*.in, sudoers.*.expected, and sudoers.*.name files, 
one file per test case.

2.  Edit the '@cases' array in testscript.pl.


David

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sudoers-secure_path-20210315-032319-dpchrist.tar.gz
Type: application/gzip
Size: 4233 bytes
Desc: not available
URL: <http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20210314/f7a7cbea/attachment.bin>


More information about the SanFrancisco-pm mailing list