Skip to content

Commit 31221d3

Browse files
committed
Improve test generation scripts
1 parent a9d1703 commit 31221d3

1 file changed

Lines changed: 10 additions & 16 deletions

File tree

‎src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st‎

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ FASTPythonImporterTest class >> generateTestNamed: aString fromCode: code [
110110
aStream
111111
cr;
112112
tab;
113-
nextPutAll: 'stack push: fast rootEntities anyOne.
113+
nextPutAll: 'stack push: fast rootEntities anyOne genericChildren first.
114114
entity := stack top.';
115-
cr;
115+
"We exclude assertions on module in generation"cr;
116116
tab.
117-
self generateAssertionsFor: model rootEntities anyOne on: aStream identation: 1 ].
117+
self generateAssertionsFor: model rootEntities anyOne genericChildren first on: aStream identation: 1 ].
118118

119119

120120

@@ -450,23 +450,17 @@ FASTPythonImporterTest >> testImportWithAlias [
450450
self assert: (fast allWithType: FASTPyImportStatement) size equals: 1.
451451
self assert: (fast allWithType: FASTPyImportedEntity) size equals: 1.
452452

453-
stack push: fast rootEntities anyOne.
453+
stack push: fast rootEntities anyOne genericChildren first.
454454
entity := stack top.
455455
self assert: entity sourceCode equals: 'import random'.
456-
self assert: (entity isOfType: FASTPyModule).
457-
self assert: entity genericChildren size equals: 1.
456+
self assert: (entity isOfType: FASTPyImportStatement).
457+
self assert: entity importedEntities size equals: 1.
458458

459-
stack push: (stack top genericChildren at: 1).
459+
stack push: (stack top importedEntities at: 1).
460460
entity := stack top.
461-
self assert: entity sourceCode equals: 'import random'.
462-
self assert: (entity isOfType: FASTPyImportStatement).
463-
self assert: entity importedEntities size equals: 1.
464-
465-
stack push: (stack top importedEntities at: 1).
466-
entity := stack top.
467-
self assert: entity sourceCode equals: 'random'.
468-
self assert: (entity isOfType: FASTPyImportedEntity).
469-
self assert: entity segments equals: #('random').
461+
self assert: entity sourceCode equals: 'random'.
462+
self assert: (entity isOfType: FASTPyImportedEntity).
463+
self assert: entity segments equals: #('random').
470464

471465
]
472466

0 commit comments

Comments
 (0)