Skip to content

Commit

Permalink
operands can contain slashes now
Browse files Browse the repository at this point in the history
  • Loading branch information
polettix committed Apr 2, 2012
1 parent f72fa39 commit dd68620
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/App/Sets/Parser.pm
Expand Up @@ -175,7 +175,7 @@ sub filename {
$retval =~ s{\\(.)}{$1}gmxs;
return [$retval, pos($string)];
}
elsif (($retval) = $string =~ m{\G ( (?: \\. | [\w.-])+ )}cgmxs) {
elsif (($retval) = $string =~ m{\G ( (?: \\. | [\w.-/])+ )}cgmxs) {
$retval =~ s{\\(.)}{$1}gmxs;
return [$retval, pos($string)];
}
Expand Down
40 changes: 40 additions & 0 deletions t/10-sets.t
@@ -0,0 +1,40 @@
# vim: filetype=perl :
use strict;
use warnings;

#use Test::More tests => 1; # last test to print
use Test::More 'no_plan'; # substitute with previous line when done
use Data::Dumper;

use lib qw< t >;
use ASTest;

for my $test (test_specifications()) { # defined below
my ($t1, $op, $t2, $result) = @{$test}{qw< t1 op t2 result >};
$t1 = locate_file($t1);
$t2 = locate_file($t2);
{
my $res = sets_run($t1, $op, $t2);
is($res->{output}, $result, "$t1 $op $t2 - as separate items");
}
{
my $res = sets_run("$t1 $op $t2");
is($res->{output}, $result, "$t1 $op $t2 - as single string");
}
}

sub test_specifications {
return (
{
t1 => 'lista1',
op => '-',
t2 => 'lista2',
result => 'nono
quarto
secondo
sesto
',
},

);
}

0 comments on commit dd68620

Please sign in to comment.