@@ -9791,30 +9791,179 @@ FASTPythonImporterTest >> testGenericType [
97919791 "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol:
97929792 Regenerate executing: self regenerateTest: #testGenericType "
97939793
9794- self parse: 'list[Path] '.
9794+ self parse: 'def f(items: List[T]): pass '.
97959795
9796+ self assert: (fast allWithType: FASTPyBlock) size equals: 1.
9797+ self assert: (fast allWithType: FASTPyFunctionDefinition) size equals: 1.
9798+ self assert: (fast allWithType: FASTPyGenericType) size equals: 1.
9799+ self assert: (fast allWithType: FASTPyIdentifier) size equals: 1.
9800+ self assert: (fast allWithType: FASTPyModule) size equals: 1.
9801+ self assert: (fast allWithType: FASTPyParameter) size equals: 1.
9802+ self assert: (fast allWithType: FASTPyPassStatement) size equals: 1.
9803+ self assert: (fast allWithType: FASTPyType) size equals: 2.
9804+
9805+ stack push: fast rootEntities anyOne containedEntities first.
9806+ self assert: self topEntity sourceCode equals: 'def f(items: List[T]): pass'.
9807+ self assert: (self topEntity isOfType: FASTPyFunctionDefinition).
9808+ self assert: (self topEntity isOfType: FASTPyTDefinition).
9809+ self assert: (self topEntity isOfType: FASTTWithParameters).
9810+ self assert: (self topEntity isOfType: FASTTWithStatements).
9811+ self assert: self topEntity name equals: 'f'.
9812+
9813+ "Testing value of multivalued relation parameters"
9814+ self assert: self topEntity parameters size equals: 1.
9815+
9816+ stack push: (stack top parameters at: 1).
9817+ self assert: self topEntity sourceCode equals: 'items: List[T]'.
9818+ self assert: (self topEntity isOfType: FASTPyParameter).
9819+ self assert: (self topEntity isOfType: FASTTVariableEntity).
9820+ self assert: self topEntity name equals: 'items'.
9821+
9822+ "Testing value of monovalue relation type"
9823+ self assert: self topEntity type isNotNil.
9824+
9825+ stack push: self topEntity type.
9826+ self assert: self topEntity sourceCode equals: 'List[T]'.
9827+ self assert: (self topEntity isOfType: FASTPyType).
9828+
9829+ "Testing value of monovalue relation content"
9830+ self assert: self topEntity content isNotNil.
9831+
9832+ stack push: self topEntity content.
9833+ self assert: self topEntity sourceCode equals: 'List[T]'.
9834+ self assert: (self topEntity isOfType: FASTPyGenericType).
9835+ self assert: self topEntity name equals: 'List'.
9836+
9837+ "Testing value of multivalued relation typeParameters"
9838+ self assert: self topEntity typeParameters size equals: 1.
9839+
9840+ stack push: (stack top typeParameters at: 1).
9841+ self assert: self topEntity sourceCode equals: 'T'.
9842+ self assert: (self topEntity isOfType: FASTPyType).
9843+
9844+ "Testing value of monovalue relation content"
9845+ self assert: self topEntity content isNotNil.
9846+
9847+ stack push: self topEntity content.
9848+ self assert: self topEntity sourceCode equals: 'T'.
9849+ self assert: (self topEntity isOfType: FASTPyIdentifier).
9850+ stack pop.
9851+ stack pop.
9852+ stack pop.
9853+ stack pop.
9854+ stack pop.
9855+
9856+ "Testing value of monovalue relation statementBlock"
9857+ self assert: self topEntity statementBlock isNotNil.
9858+
9859+ stack push: self topEntity statementBlock.
9860+ self assert: self topEntity sourceCode equals: 'pass'.
9861+ self assert: (self topEntity isOfType: FASTPyBlock).
9862+ self assert: (self topEntity isOfType: FASTTStatementBlock).
9863+
9864+ "Testing value of multivalued relation statements"
9865+ self assert: self topEntity statements size equals: 1.
9866+
9867+ stack push: (stack top statements at: 1).
9868+ self assert: self topEntity sourceCode equals: 'pass'.
9869+ self assert: (self topEntity isOfType: FASTPyPassStatement)
9870+ ]
9871+
9872+ { #category : 'tests - types' }
9873+ FASTPythonImporterTest >> testGenericTypeWithMultipleParameters [
9874+ <generated>
9875+ "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol:
9876+ Regenerate executing: self regenerateTest: #testGenericTypeWithMultipleParameters "
9877+
9878+ self parse: 'def f(items: Dictionary[str, T]): pass'.
9879+
9880+ self assert: (fast allWithType: FASTPyBlock) size equals: 1.
9881+ self assert: (fast allWithType: FASTPyFunctionDefinition) size equals: 1.
9882+ self assert: (fast allWithType: FASTPyGenericType) size equals: 1.
97969883 self assert: (fast allWithType: FASTPyIdentifier) size equals: 2.
97979884 self assert: (fast allWithType: FASTPyModule) size equals: 1.
9798- self assert: (fast allWithType: FASTPySubscript) size equals: 1.
9885+ self assert: (fast allWithType: FASTPyParameter) size equals: 1.
9886+ self assert: (fast allWithType: FASTPyPassStatement) size equals: 1.
9887+ self assert: (fast allWithType: FASTPyType) size equals: 3.
97999888
98009889 stack push: fast rootEntities anyOne containedEntities first.
9801- self assert: self topEntity sourceCode equals: 'list[Path]'.
9802- self assert: (self topEntity isOfType: FASTPySubscript).
9890+ self assert: self topEntity sourceCode equals: 'def f(items: Dictionary[str, T]): pass'.
9891+ self assert: (self topEntity isOfType: FASTPyFunctionDefinition).
9892+ self assert: (self topEntity isOfType: FASTPyTDefinition).
9893+ self assert: (self topEntity isOfType: FASTTWithParameters).
9894+ self assert: (self topEntity isOfType: FASTTWithStatements).
9895+ self assert: self topEntity name equals: 'f'.
98039896
9804- "Testing value of multivalued relation indices "
9805- self assert: self topEntity indices size equals: 1.
9897+ "Testing value of multivalued relation parameters "
9898+ self assert: self topEntity parameters size equals: 1.
98069899
9807- stack push: (stack top indices at: 1).
9808- self assert: self topEntity sourceCode equals: 'Path'.
9809- self assert: (self topEntity isOfType: FASTPyIdentifier).
9900+ stack push: (stack top parameters at: 1).
9901+ self assert: self topEntity sourceCode equals: 'items: Dictionary[str, T]'.
9902+ self assert: (self topEntity isOfType: FASTPyParameter).
9903+ self assert: (self topEntity isOfType: FASTTVariableEntity).
9904+ self assert: self topEntity name equals: 'items'.
9905+
9906+ "Testing value of monovalue relation type"
9907+ self assert: self topEntity type isNotNil.
9908+
9909+ stack push: self topEntity type.
9910+ self assert: self topEntity sourceCode equals: 'Dictionary[str, T]'.
9911+ self assert: (self topEntity isOfType: FASTPyType).
9912+
9913+ "Testing value of monovalue relation content"
9914+ self assert: self topEntity content isNotNil.
9915+
9916+ stack push: self topEntity content.
9917+ self assert: self topEntity sourceCode equals: 'Dictionary[str, T]'.
9918+ self assert: (self topEntity isOfType: FASTPyGenericType).
9919+ self assert: self topEntity name equals: 'Dictionary'.
9920+
9921+ "Testing value of multivalued relation typeParameters"
9922+ self assert: self topEntity typeParameters size equals: 2.
9923+
9924+ stack push: (stack top typeParameters at: 1).
9925+ self assert: self topEntity sourceCode equals: 'str'.
9926+ self assert: (self topEntity isOfType: FASTPyType).
9927+
9928+ "Testing value of monovalue relation content"
9929+ self assert: self topEntity content isNotNil.
9930+
9931+ stack push: self topEntity content.
9932+ self assert: self topEntity sourceCode equals: 'str'.
9933+ self assert: (self topEntity isOfType: FASTPyIdentifier).
9934+ stack pop.
9935+ stack pop.
9936+
9937+ stack push: (stack top typeParameters at: 2).
9938+ self assert: self topEntity sourceCode equals: 'T'.
9939+ self assert: (self topEntity isOfType: FASTPyType).
9940+
9941+ "Testing value of monovalue relation content"
9942+ self assert: self topEntity content isNotNil.
9943+
9944+ stack push: self topEntity content.
9945+ self assert: self topEntity sourceCode equals: 'T'.
9946+ self assert: (self topEntity isOfType: FASTPyIdentifier).
9947+ stack pop.
9948+ stack pop.
9949+ stack pop.
9950+ stack pop.
98109951 stack pop.
98119952
9812- "Testing value of monovalue relation value "
9813- self assert: self topEntity value isNotNil.
9953+ "Testing value of monovalue relation statementBlock "
9954+ self assert: self topEntity statementBlock isNotNil.
98149955
9815- stack push: self topEntity value.
9816- self assert: self topEntity sourceCode equals: 'list'.
9817- self assert: (self topEntity isOfType: FASTPyIdentifier)
9956+ stack push: self topEntity statementBlock.
9957+ self assert: self topEntity sourceCode equals: 'pass'.
9958+ self assert: (self topEntity isOfType: FASTPyBlock).
9959+ self assert: (self topEntity isOfType: FASTTStatementBlock).
9960+
9961+ "Testing value of multivalued relation statements"
9962+ self assert: self topEntity statements size equals: 1.
9963+
9964+ stack push: (stack top statements at: 1).
9965+ self assert: self topEntity sourceCode equals: 'pass'.
9966+ self assert: (self topEntity isOfType: FASTPyPassStatement)
98189967]
98199968
98209969{ #category : 'tests - statements' }
0 commit comments