Skip to content

Commit

Permalink
Test for sigspace semantics correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Mouq committed Oct 24, 2013
1 parent 55c0466 commit 5e06d2c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions S05-grammar/protos.t
Expand Up @@ -16,8 +16,8 @@ grammar Grammar::With::Protos {
token fred:sym<foo> {
<sym> \d+
}
token fred:sym<bar> {
<sym> :s 'boz'+
rule fred:sym<bar> {
<sym> 'boz'+
}
}

Expand Down
20 changes: 10 additions & 10 deletions S05-mass/rx.t
Expand Up @@ -1661,11 +1661,11 @@ ok 'a bcdef' ~~ /:s bcd/, 'sigspace (:s)';
#?pugs todo
ok 'a bcd ef' ~~ /:s bcd/, 'sigspace (:s)';

#### :s bcd abcdef n sigspace (:s)
ok 'abcdef' !~~ /:s bcd/, 'sigspace (:s)';
#### :s bcd abcdef y sigspace (:s)
ok 'abcdef' ~~ /:s bcd/, 'sigspace (:s)';

#### :s bcd abcd ef n sigspace (:s)
ok 'abcd ef' !~~ /:s bcd/, 'sigspace (:s)';
#### :s bcd abcd ef y sigspace (:s)
ok 'abcd ef' ~~ /:s bcd/, 'sigspace (:s)';

#### :s bcd ab cdef n sigspace (:s)
ok 'ab cdef' !~~ /:s bcd/, 'sigspace (:s)';
Expand All @@ -1678,8 +1678,8 @@ ok 'a b c d ef' ~~ /:s b c d/, 'sigspace (:s)';
#?pugs todo
ok 'a b c def' ~~ /:s b c d/, 'sigspace (:s)';

#### :s b c d ab c d ef n sigspace (:s)
ok 'ab c d ef' !~~ /:s b c d/, 'sigspace (:s)';
#### :s b c d ab c d ef y sigspace (:s)
ok 'ab c d ef' ~~ /:s b c d/, 'sigspace (:s)';

#### :s b c d a bcdef n sigspace (:s)
ok 'a bcdef' !~~ /:s b c d/, 'sigspace (:s)';
Expand All @@ -1695,8 +1695,8 @@ ok 'a bcdef' ~~ /:sigspace bcd/, 'sigspace (:sigspace)';
#?pugs todo
ok 'a bcd ef' ~~ /:sigspace bcd/, 'sigspace (:sigspace)';

#### :sigspace bcd abcdef n sigspace (:sigspace)
ok 'abcdef' !~~ /:sigspace bcd/, 'sigspace (:sigspace)';
#### :sigspace bcd abcdef y sigspace (:sigspace)
ok 'abcdef' ~~ /:sigspace bcd/, 'sigspace (:sigspace)';

#### :sigspace b c d a b c d ef y sigspace (:sigspace)
#?pugs todo
Expand All @@ -1706,8 +1706,8 @@ ok 'a b c d ef' ~~ /:sigspace b c d/, 'sigspace (:sigspace)';
#?pugs todo
ok 'a b c def' ~~ /:sigspace b c d/, 'sigspace (:sigspace)';

#### :sigspace b c d ab c d ef n sigspace (:sigspace)
ok 'ab c d ef' !~~ /:sigspace b c d/, 'sigspace (:sigspace)';
#### :sigspace b c d ab c d ef y sigspace (:sigspace)
ok 'ab c d ef' ~~ /:sigspace b c d/, 'sigspace (:sigspace)';

#### :s(1) b c [:s(0) d e f ] a b c def y sigspace, lexical repetition (:s)
#?niecza skip "Action method mod_arg not yet implemented"
Expand Down
4 changes: 2 additions & 2 deletions S05-metasyntax/repeat.t
Expand Up @@ -63,9 +63,9 @@ is(~('foo, bar,' ~~ m/[<alpha>+]+ % [','\s*]/), 'foo, bar', '% with a more compl
ok 'a, b, c' !~~ /:s^<alpha>+%\,$/, 'with no spaces around %, no spaces can be matched';
#?pugs todo
#?rakudo 2 todo 'nom regression'
ok 'a, b, c' ~~ /:s^ <alpha>+ % \, $/, 'with spaces around %, spaces can be matched';
ok 'a, b, c' ~~ /:s^ <alpha> +% \, $/, 'with spaces around %, spaces can be matched';
#?pugs todo
ok 'a , b ,c' ~~ /:s^ <alpha>+ % \, $/, 'same, but with leading spaces';
ok 'a , b ,c' ~~ /:s^ <alpha> +% \, $/, 'same, but with leading spaces';

# RT #76792
#?pugs todo
Expand Down
4 changes: 2 additions & 2 deletions S05-modifier/sigspace.t
Expand Up @@ -26,9 +26,9 @@ ok( "abc def" ~~ m:sigspace/abc <.ws> def/, 'Word explicit space match');

#?pugs todo
ok 'abc def' ~~ m/:s abc def/, 'inline :s (+)';
ok 'zabc def' !~~ m/:s abc def/, 'inline :s implies <.ws> immediately (-)';
#?pugs todo
ok 'zabc def' ~~ m/:s'abc' def/, 'inline :s implies <.ws> immediately (+)';
ok 'zabc def' ~~ m/:s'abc' def/, "inline :s (+)";
ok 'zabc def' ~~ m/:s abc def/, "inline :s doesn't imply <.ws> immediately (-)";


# L<S05/Modifiers/The :s modifier is considered sufficiently important>
Expand Down

0 comments on commit 5e06d2c

Please sign in to comment.