equal
deleted
inserted
replaced
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. |
37 ws2 := PPSmalltalkWhitespaceParser new. |
46 ws2 := PPSmalltalkWhitespaceParser new. |
38 |
47 |
39 self assert: ws1 = ws2. |
48 self assert: ws1 = ws2. |
40 self assert: (ws1 == ws2) not. |
49 self assert: ws1 ~~ ws2. |
41 |
50 |
42 self assert: ws1 hash = ws2 hash. |
51 self assert: ws1 hash = ws2 hash. |
|
52 |
|
53 "Modified: / 30-07-2015 / 06:56:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
43 ! ! |
54 ! ! |
44 |
55 |