Changeset 7953

Show
Ignore:
Timestamp:
11/14/05 03:15:42 (3 years ago)
Author:
luqui
svk:copy_cache_prev:
10363
Message:

Added some tests for these changes. The listop method needs
many many more, though.

Files:
3 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Lexer.hs

    r7952 r7953  
    203203charControl :: GenParser Char st Char 
    204204charControl     = do{ char 'c' 
    205                     ; code <- upper 
     205                    ; code <- upper <|> char '@' 
    206206                    ; return (toEnum (fromEnum code - fromEnum '@')) 
    207207                    } 
  • t/operators/quoting.t

    r6714 r7953  
    44use Test; 
    55 
    6 plan 73; 
     6plan 83; 
    77 
    88my $foo = "FOO"; 
     
    271271    is(@q[0].perl, (p => "moose").perl, ":pair<anglequoted>", :todo<bug>); 
    272272}; 
     273 
     274{ # weird char escape sequences 
     275    is("\d97", "a"); 
     276    is("\d102oo", "foo"); 
     277    is("\d123", chr 123); 
     278    is("\d[12]3", chr(12) ~ "3"); 
     279    is("\d[12] 3", chr(12) ~ " 3"); 
     280 
     281    is("\x41", "A"); 
     282    is("\o101", "A"); 
     283 
     284    is("\c@", "\0"); 
     285    is("\cA", chr 1); 
     286    is("\cZ", chr 26); 
     287} 
  • t/syntax/parsing/sub_calls.t

    r7625 r7953  
    44use Test; 
    55 
    6 plan 19; 
     6plan 20; 
    77 
    88# Since these are all parsing tests, they should use eval to ensure all tests 
     
    5757    is(eval(q/first.second/), 'firstsecond', '`first.second` means `&second(&first())`'); 
    5858} 
     59 
     60{ 
     61    is(eval(q/"hello".substr: 1, 2/), "el", "listop method"); 
     62 
     63    # foo $bar.baz: quux  
     64    # should be (and is currently) interpreted as: 
     65    # foo($bar.baz(quux)) 
     66    # where the alternate interpretation can be achieved by: 
     67    # foo ($bar.baz): quux 
     68    # which is interpreted as 
     69    # $bar.baz.foo(quux) 
     70    # but we need tests, tests, tests! XXX 
     71}