compiler/tests/extras/PPCSmalltalkTests.st
changeset 516 3b81c9e53352
parent 510 869853decf31
parent 515 b5316ef15274
child 525 751532c8f3db
equal deleted inserted replaced
514:46dd1237b20a 516:3b81c9e53352
     9 	category:'PetitCompiler-Extras-Tests-Smalltalk'
     9 	category:'PetitCompiler-Extras-Tests-Smalltalk'
    10 !
    10 !
    11 
    11 
    12 !PPCSmalltalkTests methodsFor:'as yet unclassified'!
    12 !PPCSmalltalkTests methodsFor:'as yet unclassified'!
    13 
    13 
       
    14 configuration
       
    15     arguments := PPCArguments default
       
    16         profile: true;
       
    17         yourself.
       
    18         
       
    19     ^ PPCTokenizingConfiguration new
       
    20         arguments: arguments;
       
    21         yourself.
       
    22 !
       
    23 
    14 setUp
    24 setUp
    15     arguments := PPCArguments default
    25     arguments := PPCArguments default
    16         profile: true;
    26         profile: true;
    17         yourself.
    27         yourself.
    18         
    28         
    20         arguments: arguments;
    30         arguments: arguments;
    21         yourself.
    31         yourself.
    22 !
    32 !
    23 
    33 
    24 testSmalltakToken
    34 testSmalltakToken
    25     | token1 token2 |
    35     | token1  |
    26     arguments generate: false.
    36     configuration := self configuration.
    27     token1 := 'a' asParser smalltalkToken compileWithConfiguration: configuration.
    37     token1 := 'a' asParser smalltalkToken compileWithConfiguration: configuration.
    28     token2 := 'b' asParser smalltalkToken compileWithConfiguration: configuration.
       
    29     
    38     
    30     self assert: token1 tokenizer children first tokenClass = PPSmalltalkToken.
    39     self assert: ((token1 parse: 'a') class == PPSmalltalkToken).
    31     self assert: token1 tokenizer children first whitespace = token1 tokenizer children first  whitespace.
    40     self assert: (token1 parse: '"comment" a "another comment"') inputValue = 'a'
    32 !
    41 !
    33 
    42 
    34 testSmalltakWhitespace
    43 testSmalltakWhitespace
    35     | ws1 ws2 |
    44     | ws1 ws2 |
    36     ws1 := PPSmalltalkWhitespaceParser new.
    45     ws1 := PPSmalltalkWhitespaceParser new.