@@ -2447,6 +2447,59 @@ FASTPythonImporterTest >> testAssignmentToUnaryOperator [
24472447 self assert: self topEntity operator equals: '-'
24482448]
24492449
2450+ { #category : 'tests - assignments' }
2451+ FASTPythonImporterTest >> testAssignmentType [
2452+ <generated>
2453+ "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol:
2454+ Regenerate executing: self regenerateTest: #testAssignmentType "
2455+
2456+ self parse: 'int: x = 1'.
2457+
2458+ self assert: (fast allWithType: FASTPyAssignment) size equals: 1.
2459+ self assert: (fast allWithType: FASTPyIdentifier) size equals: 1.
2460+ self assert: (fast allWithType: FASTPyInteger) size equals: 1.
2461+ self assert: (fast allWithType: FASTPyModule) size equals: 1.
2462+ self assert: (fast allWithType: FASTPyType) size equals: 1.
2463+ self assert: (fast allWithType: FASTPyVariable) size equals: 1.
2464+
2465+ stack push: fast rootEntities anyOne containedEntities first.
2466+ self assert: self topEntity sourceCode equals: 'int: x = 1'.
2467+ self assert: (self topEntity isOfType: FASTPyAssignment).
2468+
2469+ "Testing value of monovalue relation left"
2470+ self assert: self topEntity left isNotNil.
2471+
2472+ stack push: self topEntity left.
2473+ self assert: self topEntity sourceCode equals: 'int'.
2474+ self assert: (self topEntity isOfType: FASTPyVariable).
2475+ self assert: (self topEntity isOfType: FASTTVariableEntity).
2476+ stack pop.
2477+
2478+ "Testing value of monovalue relation right"
2479+ self assert: self topEntity right isNotNil.
2480+
2481+ stack push: self topEntity right.
2482+ self assert: self topEntity sourceCode equals: '1'.
2483+ self assert: (self topEntity isOfType: FASTPyInteger).
2484+ self assert: (self topEntity isOfType: FASTTLiteral).
2485+ self assert: (self topEntity isOfType: FASTTNumericalLiteral).
2486+ stack pop.
2487+
2488+ "Testing value of monovalue relation type"
2489+ self assert: self topEntity type isNotNil.
2490+
2491+ stack push: self topEntity type.
2492+ self assert: self topEntity sourceCode equals: 'x'.
2493+ self assert: (self topEntity isOfType: FASTPyType).
2494+
2495+ "Testing value of monovalue relation expression"
2496+ self assert: self topEntity expression isNotNil.
2497+
2498+ stack push: self topEntity expression.
2499+ self assert: self topEntity sourceCode equals: 'x'.
2500+ self assert: (self topEntity isOfType: FASTPyIdentifier)
2501+ ]
2502+
24502503{ #category : 'tests - accesses' }
24512504FASTPythonImporterTest >> testAttributeAccess [
24522505 <generated>
0 commit comments