The Trunk: ShoutTests-mt.33.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: ShoutTests-mt.33.mcz

commits-2
Marcel Taeumel uploaded a new version of ShoutTests to project The Trunk:
http://source.squeak.org/trunk/ShoutTests-mt.33.mcz

==================== Summary ====================

Name: ShoutTests-mt.33
Author: mt
Time: 15 June 2020, 7:11:13.69319 pm
UUID: 4e2ec3ca-d00f-9e42-ba19-a945f18fbc47
Ancestors: ShoutTests-ct.32

Adds a test for custom pragma parsing.

=============== Diff against ShoutTests-ct.32 ===============

Item was added:
+ ----- Method: SHParserST80Test>>customPragma (in category 'tests-manual') -----
+ customPragma
+ <shoutTestPragma: 42>!

Item was added:
+ ----- Method: SHParserST80Test>>shoutTestPragma (in category 'utilities') -----
+ shoutTestPragma
+ <pragmaParser>
+
+ self addRangeType: #shoutTestPragmaSuccess.
+ self parsePragmaDefault.!

Item was added:
+ ----- Method: SHParserST80Test>>testPragmaParser (in category 'tests') -----
+ testPragmaParser
+
+ | source pragmaParser |
+ source := (self class compiledMethodAt: #customPragma) getSource.
+ pragmaParser := (self class compiledMethodAt: #shoutTestPragma) copy.
+
+ self deny: ((self tokenTypesIn: source) includes: #shoutTestPragmaSuccess).
+ [SHParserST80 basicAddSelector: #shoutTestPragma withMethod: pragmaParser.
+ self assert: ((self tokenTypesIn: source) includes: #shoutTestPragmaSuccess)]
+ ensure: [SHParserST80 basicRemoveSelector: #shoutTestPragma].
+ self deny: ((self tokenTypesIn: source) includes: #shoutTestPragmaSuccess).!