@@ -3395,6 +3395,28 @@ FamixPythonProject1Test >> testLocalMethodInvocationSourceAnchor [
33953395 self assert: invocation sourceText equals: 'self.get_name()'
33963396]
33973397
3398+ { #category : 'tests - local variables' }
3399+ FamixPythonProject1Test >> testLocalVariableInDictionaryComprehension [
3400+
3401+ | variable |
3402+ variable := self localVariableNamed: 'localVariableInDictionaryComprehension'.
3403+
3404+ self assert: variable class equals: FamixPythonLocalVariable.
3405+ self assert: variable name equals: 'localVariableInDictionaryComprehension'.
3406+ self assert: variable parentBehaviouralEntity equals: (self moduleNamed: 'moduleAtRoot15').
3407+ self deny: variable isStub
3408+ ]
3409+
3410+ { #category : 'tests - local variables' }
3411+ FamixPythonProject1Test >> testLocalVariableInDictionaryComprehensionSourceAnchor [
3412+
3413+ | variable |
3414+ variable := self localVariableNamed: 'localVariableInDictionaryComprehension'.
3415+
3416+ self assert: variable sourceAnchor isNotNil.
3417+ self assert: variable sourceText equals: 'localVariableInDictionaryComprehension'
3418+ ]
3419+
33983420{ #category : 'tests - local variables' }
33993421FamixPythonProject1Test >> testLocalVariableInFunctionSourceAnchor [
34003422
@@ -5752,6 +5774,25 @@ FamixPythonProject1Test >> testReadAccessInUnaryOperator [
57525774 self assert: (module accesses anySatisfy: [ :anAccess | anAccess variable = global ])
57535775]
57545776
5777+ { #category : ' tests - accesses' }
5778+ FamixPythonProject1Test >> testReadAccessOfLocalInDictionaryComprehension [
5779+
5780+ | global module access |
5781+ global := self localVariableNamed: ' localVarToAccessInDictionaryComprehension' .
5782+ module := self moduleNamed: ' moduleAtRoot13' .
5783+
5784+ access := (global incomingAccesses select: [ :anAccess | anAccess accessor = module ]) detectMax: [ :anAccess | anAccess sourceAnchor startPos ].
5785+
5786+ self assert: access class equals: FamixPythonAccess.
5787+ self assert: access source equals: module.
5788+ self assert: access accessor equals: module.
5789+ self assert: access target equals: global.
5790+ self assert: access variable equals: global.
5791+ self deny: access isWrite.
5792+ self assert: access isRead.
5793+ self assert: (module accesses anySatisfy: [ :anAccess | anAccess variable = global ])
5794+ ]
5795+
57555796{ #category : ' tests - accesses' }
57565797FamixPythonProject1Test >> testReadAccessSourceAnchor [
57575798
0 commit comments