@@ -6875,6 +6875,57 @@ FASTPythonImporterTest >> testSliceBinaryOperator [
68756875 self assert: (self topEntity isOfType: FASTPyIdentifier )
68766876]
68776877
6878+ { #category : ' tests - subscripts' }
6879+ FASTPythonImporterTest >> testSliceBoolean [
6880+ < generated>
6881+ " Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol:
6882+ Regenerate executing: self regenerateTest: #testSliceBoolean "
6883+
6884+ self parse: ' lst[True:False]' .
6885+
6886+ self assert: (fast allWithType: FASTPyBoolean ) size equals: 2 .
6887+ self assert: (fast allWithType: FASTPyIdentifier ) size equals: 1 .
6888+ self assert: (fast allWithType: FASTPyModule ) size equals: 1 .
6889+ self assert: (fast allWithType: FASTPySlice ) size equals: 1 .
6890+ self assert: (fast allWithType: FASTPySubscript ) size equals: 1 .
6891+
6892+ stack push: fast rootEntities anyOne containedEntities first.
6893+ self assert: self topEntity sourceCode equals: ' lst[True:False]' .
6894+ self assert: (self topEntity isOfType: FASTPySubscript ).
6895+
6896+ " Testing value of multivalued relation indices"
6897+ self assert: self topEntity indices size equals: 1 .
6898+
6899+ stack push: (stack top indices at: 1 ).
6900+ self assert: self topEntity sourceCode equals: ' True:False' .
6901+ self assert: (self topEntity isOfType: FASTPySlice ).
6902+
6903+ " Testing value of multivalued relation components"
6904+ self assert: self topEntity components size equals: 2 .
6905+
6906+ stack push: (stack top components at: 1 ).
6907+ self assert: self topEntity sourceCode equals: ' True' .
6908+ self assert: (self topEntity isOfType: FASTPyBoolean ).
6909+ self assert: (self topEntity isOfType: FASTTBooleanLiteral ).
6910+ self assert: (self topEntity isOfType: FASTTLiteral ).
6911+ stack pop.
6912+
6913+ stack push: (stack top components at: 2 ).
6914+ self assert: self topEntity sourceCode equals: ' False' .
6915+ self assert: (self topEntity isOfType: FASTPyBoolean ).
6916+ self assert: (self topEntity isOfType: FASTTBooleanLiteral ).
6917+ self assert: (self topEntity isOfType: FASTTLiteral ).
6918+ stack pop.
6919+ stack pop.
6920+
6921+ " Testing value of monovalue relation value"
6922+ self assert: self topEntity value isNotNil.
6923+
6924+ stack push: self topEntity value.
6925+ self assert: self topEntity sourceCode equals: ' lst' .
6926+ self assert: (self topEntity isOfType: FASTPyIdentifier )
6927+ ]
6928+
68786929{ #category : ' tests - subscripts' }
68796930FASTPythonImporterTest >> testSliceCall [
68806931 < generated>
@@ -6943,6 +6994,78 @@ FASTPythonImporterTest >> testSliceCall [
69436994 self assert: (self topEntity isOfType: FASTPyIdentifier )
69446995]
69456996
6997+ { #category : ' tests - subscripts' }
6998+ FASTPythonImporterTest >> testSliceConditionalExpression [
6999+ < generated>
7000+ " Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol:
7001+ Regenerate executing: self regenerateTest: #testSliceConditionalExpression "
7002+
7003+ self parse: ' lst[a if cond else b:c]' .
7004+
7005+ self assert: (fast allWithType: FASTPyConditionalExpression ) size equals: 1 .
7006+ self assert: (fast allWithType: FASTPyIdentifier ) size equals: 5 .
7007+ self assert: (fast allWithType: FASTPyModule ) size equals: 1 .
7008+ self assert: (fast allWithType: FASTPySlice ) size equals: 1 .
7009+ self assert: (fast allWithType: FASTPySubscript ) size equals: 1 .
7010+
7011+ stack push: fast rootEntities anyOne containedEntities first.
7012+ self assert: self topEntity sourceCode equals: ' lst[a if cond else b:c]' .
7013+ self assert: (self topEntity isOfType: FASTPySubscript ).
7014+
7015+ " Testing value of multivalued relation indices"
7016+ self assert: self topEntity indices size equals: 1 .
7017+
7018+ stack push: (stack top indices at: 1 ).
7019+ self assert: self topEntity sourceCode equals: ' a if cond else b:c' .
7020+ self assert: (self topEntity isOfType: FASTPySlice ).
7021+
7022+ " Testing value of multivalued relation components"
7023+ self assert: self topEntity components size equals: 2 .
7024+
7025+ stack push: (stack top components at: 1 ).
7026+ self assert: self topEntity sourceCode equals: ' a if cond else b' .
7027+ self assert: (self topEntity isOfType: FASTPyConditionalExpression ).
7028+ self assert: (self topEntity isOfType: FASTTWithCondition ).
7029+
7030+ " Testing value of monovalue relation condition"
7031+ self assert: self topEntity condition isNotNil.
7032+
7033+ stack push: self topEntity condition.
7034+ self assert: self topEntity sourceCode equals: ' cond' .
7035+ self assert: (self topEntity isOfType: FASTPyIdentifier ).
7036+ stack pop.
7037+
7038+ " Testing value of monovalue relation elseExpression"
7039+ self assert: self topEntity elseExpression isNotNil.
7040+
7041+ stack push: self topEntity elseExpression.
7042+ self assert: self topEntity sourceCode equals: ' b' .
7043+ self assert: (self topEntity isOfType: FASTPyIdentifier ).
7044+ stack pop.
7045+
7046+ " Testing value of monovalue relation thenExpression"
7047+ self assert: self topEntity thenExpression isNotNil.
7048+
7049+ stack push: self topEntity thenExpression.
7050+ self assert: self topEntity sourceCode equals: ' a' .
7051+ self assert: (self topEntity isOfType: FASTPyIdentifier ).
7052+ stack pop.
7053+ stack pop.
7054+
7055+ stack push: (stack top components at: 2 ).
7056+ self assert: self topEntity sourceCode equals: ' c' .
7057+ self assert: (self topEntity isOfType: FASTPyIdentifier ).
7058+ stack pop.
7059+ stack pop.
7060+
7061+ " Testing value of monovalue relation value"
7062+ self assert: self topEntity value isNotNil.
7063+
7064+ stack push: self topEntity value.
7065+ self assert: self topEntity sourceCode equals: ' lst' .
7066+ self assert: (self topEntity isOfType: FASTPyIdentifier )
7067+ ]
7068+
69467069{ #category : ' tests - subscripts' }
69477070FASTPythonImporterTest >> testSliceEmpty [
69487071 < generated>
@@ -7972,6 +8095,79 @@ FASTPythonImporterTest >> testSubscriptWithTwoIndicies [
79728095 self assert: (self topEntity isOfType: FASTPyIdentifier )
79738096]
79748097
8098+ { #category : ' tests - subscripts' }
8099+ FASTPythonImporterTest >> testSubscriptWithTwoSlices [
8100+ < generated>
8101+ " Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol:
8102+ Regenerate executing: self regenerateTest: #testSubscriptWithTwoSlices "
8103+
8104+ self parse: ' arr[1:3, 2:4] ' .
8105+
8106+ self assert: (fast allWithType: FASTPyIdentifier ) size equals: 1 .
8107+ self assert: (fast allWithType: FASTPyInteger ) size equals: 4 .
8108+ self assert: (fast allWithType: FASTPyModule ) size equals: 1 .
8109+ self assert: (fast allWithType: FASTPySlice ) size equals: 2 .
8110+ self assert: (fast allWithType: FASTPySubscript ) size equals: 1 .
8111+
8112+ stack push: fast rootEntities anyOne containedEntities first.
8113+ self assert: self topEntity sourceCode equals: ' arr[1:3, 2:4]' .
8114+ self assert: (self topEntity isOfType: FASTPySubscript ).
8115+
8116+ " Testing value of multivalued relation indices"
8117+ self assert: self topEntity indices size equals: 2 .
8118+
8119+ stack push: (stack top indices at: 1 ).
8120+ self assert: self topEntity sourceCode equals: ' 1:3' .
8121+ self assert: (self topEntity isOfType: FASTPySlice ).
8122+
8123+ " Testing value of multivalued relation components"
8124+ self assert: self topEntity components size equals: 2 .
8125+
8126+ stack push: (stack top components at: 1 ).
8127+ self assert: self topEntity sourceCode equals: ' 1' .
8128+ self assert: (self topEntity isOfType: FASTPyInteger ).
8129+ self assert: (self topEntity isOfType: FASTTLiteral ).
8130+ self assert: (self topEntity isOfType: FASTTNumericalLiteral ).
8131+ stack pop.
8132+
8133+ stack push: (stack top components at: 2 ).
8134+ self assert: self topEntity sourceCode equals: ' 3' .
8135+ self assert: (self topEntity isOfType: FASTPyInteger ).
8136+ self assert: (self topEntity isOfType: FASTTLiteral ).
8137+ self assert: (self topEntity isOfType: FASTTNumericalLiteral ).
8138+ stack pop.
8139+ stack pop.
8140+
8141+ stack push: (stack top indices at: 2 ).
8142+ self assert: self topEntity sourceCode equals: ' 2:4' .
8143+ self assert: (self topEntity isOfType: FASTPySlice ).
8144+
8145+ " Testing value of multivalued relation components"
8146+ self assert: self topEntity components size equals: 2 .
8147+
8148+ stack push: (stack top components at: 1 ).
8149+ self assert: self topEntity sourceCode equals: ' 2' .
8150+ self assert: (self topEntity isOfType: FASTPyInteger ).
8151+ self assert: (self topEntity isOfType: FASTTLiteral ).
8152+ self assert: (self topEntity isOfType: FASTTNumericalLiteral ).
8153+ stack pop.
8154+
8155+ stack push: (stack top components at: 2 ).
8156+ self assert: self topEntity sourceCode equals: ' 4' .
8157+ self assert: (self topEntity isOfType: FASTPyInteger ).
8158+ self assert: (self topEntity isOfType: FASTTLiteral ).
8159+ self assert: (self topEntity isOfType: FASTTNumericalLiteral ).
8160+ stack pop.
8161+ stack pop.
8162+
8163+ " Testing value of monovalue relation value"
8164+ self assert: self topEntity value isNotNil.
8165+
8166+ stack push: self topEntity value.
8167+ self assert: self topEntity sourceCode equals: ' arr' .
8168+ self assert: (self topEntity isOfType: FASTPyIdentifier )
8169+ ]
8170+
79758171{ #category : ' tests - literals' }
79768172FASTPythonImporterTest >> testTrue [
79778173
0 commit comments