Skip to content

Commit

Permalink
Add tests about variables of the same name in different classes
Browse files Browse the repository at this point in the history
  • Loading branch information
jecisc committed Oct 24, 2024
1 parent 1d09b20 commit 826f3a1
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/Famix-Python-Importer-Tests/FamixPythonProject1Test.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,18 @@ FamixPythonProject1Test >> testClassVariableSourceAnchor [
self assert: variable sourceAnchor endPos equals: 581
]

{ #category : 'tests - attributes' }
FamixPythonProject1Test >> testClassVariablesWithSameNameButDifferenClass [

| variables |
variables := self model allAttributes select: [ :variable | variable name = 'furniture_color' ].

self assert: variables size equals: 2.
self assertCollection: (variables flatCollect: #parents) hasSameElements: {
(self classNamed: 'Chair').
(self classNamed: 'Stool') }
]

{ #category : 'tests - methods' }
FamixPythonProject1Test >> testConstructor [

Expand Down Expand Up @@ -602,6 +614,18 @@ FamixPythonProject1Test >> testInstanceVariableSourceAnchor [
self assert: variable sourceAnchor endPos equals: 361
]

{ #category : 'tests - attributes' }
FamixPythonProject1Test >> testInstanceVariablesWithSameNameButDifferenClass [

| variables |
variables := self model allAttributes select: [ :variable | variable name = 'number_of_legs' ].

self assert: variables size equals: 2.
self assertCollection: (variables flatCollect: #parents) hasSameElements: {
(self classNamed: 'Chair').
(self classNamed: 'Stool') }
]

{ #category : 'tests - from-import' }
FamixPythonProject1Test >> testMethodImportsClassFromAModule [

Expand Down

0 comments on commit 826f3a1

Please sign in to comment.