Skip to content

Commit

Permalink
Merge pull request #791 from moosetechnology/isSharedVariable
Browse files Browse the repository at this point in the history
Shared variable properties should be persisted
  • Loading branch information
jecisc authored Jun 18, 2024
2 parents 4440fd1 + ee5ee06 commit 6bfc2d9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/Famix-PharoSmalltalk-Entities/FamixStAttribute.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,16 @@ FamixStAttribute class >> annotation [
^ self
]

{ #category : #'Famix-Implementation' }
{ #category : #properties }
FamixStAttribute >> beSharedVariable [

self propertyNamed: #sharedVariable put: true
^ self attributeAt: #isSharedVariable put: true
]

{ #category : #'Famix-Implementation' }
{ #category : #testing }
FamixStAttribute >> isSharedVariable [
^ self propertyNamed: #sharedVariable ifNil: [ false ]

<FMProperty: #isSharedVariable type: #Boolean>
<FMComment: 'True if the attribute is a shared variable'>
^ self attributeAt: #isSharedVariable ifAbsent: [ false ]
]
17 changes: 16 additions & 1 deletion src/Famix-PharoSmalltalk-Tests/FamixPharoAttributeTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,23 @@ Class {

{ #category : #tests }
FamixPharoAttributeTest >> testIsClassSide [

| attribute |
attribute := FamixStAttribute new.
attribute isClassSide: true.
self assert: attribute isClassSide .
self assert: attribute isClassSide
]

{ #category : #tests }
FamixPharoAttributeTest >> testSharedVariableArePersisted [

| attribute |
attribute := FamixStAttribute new.
attribute
isClassSide: true;
beSharedVariable.
self assert: attribute isSharedVariable.

attribute flush.
self assert: attribute isSharedVariable
]

0 comments on commit 6bfc2d9

Please sign in to comment.