@@ -869,6 +869,221 @@ FASTPythonImporterTest >> testAssignment [
869869 self assert: (self topEntity isOfType: FASTTNumericalLiteral )
870870]
871871
872+ { #category : ' tests - assignment' }
873+ FASTPythonImporterTest >> testAssignmentInAttribute [
874+ < generated>
875+ " Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol:
876+ Regenerate executing: self regenerateTest: #testAssignmentInAttribute "
877+
878+ self parse: ' x.y = 1' .
879+
880+ self assert: (fast allWithType: FASTPyAssignment ) size equals: 1 .
881+ self assert: (fast allWithType: FASTPyAttributeAccess ) size equals: 1 .
882+ self assert: (fast allWithType: FASTPyIdentifier ) size equals: 2 .
883+ self assert: (fast allWithType: FASTPyInteger ) size equals: 1 .
884+ self assert: (fast allWithType: FASTPyModule ) size equals: 1 .
885+
886+ stack push: fast rootEntities anyOne containedEntities first.
887+ self assert: self topEntity sourceCode equals: ' x.y = 1' .
888+ self assert: (self topEntity isOfType: FASTPyAssignment ).
889+
890+ " Testing value of monovalue relation left"
891+ self assert: self topEntity left isNotNil.
892+
893+ stack push: self topEntity left.
894+ self assert: self topEntity sourceCode equals: ' x.y' .
895+ self assert: (self topEntity isOfType: FASTPyAttributeAccess ).
896+
897+ " Testing value of monovalue relation attribute"
898+ self assert: self topEntity attribute isNotNil.
899+
900+ stack push: self topEntity attribute.
901+ self assert: self topEntity sourceCode equals: ' y' .
902+ self assert: (self topEntity isOfType: FASTPyIdentifier ).
903+ stack pop.
904+
905+ " Testing value of monovalue relation object"
906+ self assert: self topEntity object isNotNil.
907+
908+ stack push: self topEntity object.
909+ self assert: self topEntity sourceCode equals: ' x' .
910+ self assert: (self topEntity isOfType: FASTPyIdentifier ).
911+ stack pop.
912+ stack pop.
913+
914+ " Testing value of monovalue relation right"
915+ self assert: self topEntity right isNotNil.
916+
917+ stack push: self topEntity right.
918+ self assert: self topEntity sourceCode equals: ' 1' .
919+ self assert: (self topEntity isOfType: FASTPyInteger ).
920+ self assert: (self topEntity isOfType: FASTTLiteral ).
921+ self assert: (self topEntity isOfType: FASTTNumericalLiteral )
922+ ]
923+
924+ { #category : ' tests - assignment' }
925+ FASTPythonImporterTest >> testAssignmentInSlice [
926+ < generated>
927+ " Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol:
928+ Regenerate executing: self regenerateTest: #testAssignmentInSlice "
929+
930+ self parse: ' lst[i:j] = seq' .
931+
932+ self assert: (fast allWithType: FASTPyAssignment ) size equals: 1 .
933+ self assert: (fast allWithType: FASTPyIdentifier ) size equals: 4 .
934+ self assert: (fast allWithType: FASTPyModule ) size equals: 1 .
935+ self assert: (fast allWithType: FASTPySlice ) size equals: 1 .
936+ self assert: (fast allWithType: FASTPySubscript ) size equals: 1 .
937+
938+ stack push: fast rootEntities anyOne containedEntities first.
939+ self assert: self topEntity sourceCode equals: ' lst[i:j] = seq' .
940+ self assert: (self topEntity isOfType: FASTPyAssignment ).
941+
942+ " Testing value of monovalue relation left"
943+ self assert: self topEntity left isNotNil.
944+
945+ stack push: self topEntity left.
946+ self assert: self topEntity sourceCode equals: ' lst[i:j]' .
947+ self assert: (self topEntity isOfType: FASTPySubscript ).
948+
949+ " Testing value of multivalued relation indices"
950+ self assert: self topEntity indices size equals: 1 .
951+
952+ stack push: (stack top indices at: 1 ).
953+ self assert: self topEntity sourceCode equals: ' i:j' .
954+ self assert: (self topEntity isOfType: FASTPySlice ).
955+
956+ " Testing value of multivalued relation components"
957+ self assert: self topEntity components size equals: 2 .
958+
959+ stack push: (stack top components at: 1 ).
960+ self assert: self topEntity sourceCode equals: ' i' .
961+ self assert: (self topEntity isOfType: FASTPyIdentifier ).
962+ stack pop.
963+
964+ stack push: (stack top components at: 2 ).
965+ self assert: self topEntity sourceCode equals: ' j' .
966+ self assert: (self topEntity isOfType: FASTPyIdentifier ).
967+ stack pop.
968+ stack pop.
969+
970+ " Testing value of monovalue relation value"
971+ self assert: self topEntity value isNotNil.
972+
973+ stack push: self topEntity value.
974+ self assert: self topEntity sourceCode equals: ' lst' .
975+ self assert: (self topEntity isOfType: FASTPyIdentifier ).
976+ stack pop.
977+ stack pop.
978+
979+ " Testing value of monovalue relation right"
980+ self assert: self topEntity right isNotNil.
981+
982+ stack push: self topEntity right.
983+ self assert: self topEntity sourceCode equals: ' seq' .
984+ self assert: (self topEntity isOfType: FASTPyIdentifier )
985+ ]
986+
987+ { #category : ' tests - assignment' }
988+ FASTPythonImporterTest >> testAssignmentInSubscript [
989+ < generated>
990+ " Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol:
991+ Regenerate executing: self regenerateTest: #testAssignmentInSubscript "
992+
993+ self parse: ' variables[1] = 1' .
994+
995+ self assert: (fast allWithType: FASTPyAssignment ) size equals: 1 .
996+ self assert: (fast allWithType: FASTPyIdentifier ) size equals: 1 .
997+ self assert: (fast allWithType: FASTPyInteger ) size equals: 2 .
998+ self assert: (fast allWithType: FASTPyModule ) size equals: 1 .
999+ self assert: (fast allWithType: FASTPySubscript ) size equals: 1 .
1000+
1001+ stack push: fast rootEntities anyOne containedEntities first.
1002+ self assert: self topEntity sourceCode equals: ' variables[1] = 1' .
1003+ self assert: (self topEntity isOfType: FASTPyAssignment ).
1004+
1005+ " Testing value of monovalue relation left"
1006+ self assert: self topEntity left isNotNil.
1007+
1008+ stack push: self topEntity left.
1009+ self assert: self topEntity sourceCode equals: ' variables[1]' .
1010+ self assert: (self topEntity isOfType: FASTPySubscript ).
1011+
1012+ " Testing value of multivalued relation indices"
1013+ self assert: self topEntity indices size equals: 1 .
1014+
1015+ stack push: (stack top indices at: 1 ).
1016+ self assert: self topEntity sourceCode equals: ' 1' .
1017+ self assert: (self topEntity isOfType: FASTPyInteger ).
1018+ self assert: (self topEntity isOfType: FASTTLiteral ).
1019+ self assert: (self topEntity isOfType: FASTTNumericalLiteral ).
1020+ stack pop.
1021+
1022+ " Testing value of monovalue relation value"
1023+ self assert: self topEntity value isNotNil.
1024+
1025+ stack push: self topEntity value.
1026+ self assert: self topEntity sourceCode equals: ' variables' .
1027+ self assert: (self topEntity isOfType: FASTPyIdentifier ).
1028+ stack pop.
1029+ stack pop.
1030+
1031+ " Testing value of monovalue relation right"
1032+ self assert: self topEntity right isNotNil.
1033+
1034+ stack push: self topEntity right.
1035+ self assert: self topEntity sourceCode equals: ' 1' .
1036+ self assert: (self topEntity isOfType: FASTPyInteger ).
1037+ self assert: (self topEntity isOfType: FASTTLiteral ).
1038+ self assert: (self topEntity isOfType: FASTTNumericalLiteral )
1039+ ]
1040+
1041+ { #category : ' tests - assignment' }
1042+ FASTPythonImporterTest >> testAssignmentInTuple [
1043+ < generated>
1044+ " Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol:
1045+ Regenerate executing: self regenerateTest: #testAssignmentInTuple "
1046+
1047+ self parse: ' (a, b) = x' .
1048+
1049+ self assert: (fast allWithType: FASTPyAssignment ) size equals: 1 .
1050+ self assert: (fast allWithType: FASTPyIdentifier ) size equals: 3 .
1051+ self assert: (fast allWithType: FASTPyModule ) size equals: 1 .
1052+ self assert: (fast allWithType: FASTPyTuplePattern ) size equals: 1 .
1053+
1054+ stack push: fast rootEntities anyOne containedEntities first.
1055+ self assert: self topEntity sourceCode equals: ' (a, b) = x' .
1056+ self assert: (self topEntity isOfType: FASTPyAssignment ).
1057+
1058+ " Testing value of monovalue relation left"
1059+ self assert: self topEntity left isNotNil.
1060+
1061+ stack push: self topEntity left.
1062+ self assert: self topEntity sourceCode equals: ' (a, b)' .
1063+ self assert: (self topEntity isOfType: FASTPyTuplePattern ).
1064+
1065+ " Testing value of multivalued relation patterns"
1066+ self assert: self topEntity patterns size equals: 2 .
1067+
1068+ stack push: (stack top patterns at: 1 ).
1069+ self assert: self topEntity sourceCode equals: ' a' .
1070+ self assert: (self topEntity isOfType: FASTPyIdentifier ).
1071+ stack pop.
1072+
1073+ stack push: (stack top patterns at: 2 ).
1074+ self assert: self topEntity sourceCode equals: ' b' .
1075+ self assert: (self topEntity isOfType: FASTPyIdentifier ).
1076+ stack pop.
1077+ stack pop.
1078+
1079+ " Testing value of monovalue relation right"
1080+ self assert: self topEntity right isNotNil.
1081+
1082+ stack push: self topEntity right.
1083+ self assert: self topEntity sourceCode equals: ' x' .
1084+ self assert: (self topEntity isOfType: FASTPyIdentifier )
1085+ ]
1086+
8721087{ #category : ' tests - accesses' }
8731088FASTPythonImporterTest >> testAttributeAccess [
8741089 < generated>
0 commit comments