Skip to content

Commit

Permalink
Add source anchors to model and add test on source anchor
Browse files Browse the repository at this point in the history
  • Loading branch information
jecisc committed Sep 12, 2024
1 parent 6eb121f commit 0bdcb03
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Famix-Python-Importer-Tests/FamixPythonProject1Test.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ FamixPythonProject1Test >> testModuleInSubPackage [
self assert: module parentPackage equals: (self packageNamed: 'subpackage1')
]

{ #category : 'tests - packages' }
FamixPythonProject1Test >> testPackageSourceAnchor [

| rootPackage |
self denyEmpty: self model allPackages.

rootPackage := self packageNamed: 'root'.

self assert: rootPackage sourceAnchor mooseModel equals: self model.
self assert: rootPackage sourceAnchor sourceText equals: (FamixPythonBridge parsingExamples / 'project1' / 'root' / '__init__.py') contents
]

{ #category : 'tests - modules' }
FamixPythonProject1Test >> testRootModule [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ FamixPythonImporterVisitor >> setSourceAnchor: aFamixEntity from: aSmaccNode [
fileName: (self relativeFilePath: aSmaccNode) ;
startPos: aSmaccNode startPosition;
endPos: aSmaccNode stopPosition;
mooseModel: self model;
yourself).

aFamixEntity stub: false.
Expand Down

0 comments on commit 0bdcb03

Please sign in to comment.