Skip to content

Commit

Permalink
testing iASTToFamix
Browse files Browse the repository at this point in the history
  • Loading branch information
anquetil committed Jun 27, 2024
1 parent ac783b7 commit cb8fe5f
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/EsopeImporter-Tests/FortranProjectImporterTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,44 @@ FortranProjectImporterTest >> testGetIncludedFile [
self assert: names equals: 'blah.inc'
]

{ #category : #'tests - import steps' }
FortranProjectImporterTest >> testIASTToFamix [
"json file and assert: taken from
IASTToFamixVisitorTest >> testFamixFortran77PUFunctionWithParameter"

| iastEntity fmxEntity param |
iastEntity := IASTParameter new
entityName: 'var' ;
yourself.
iastEntity := IASTFunction new
entityName: 'fct' ;
parameters: { iastEntity } ;
yourself.
iastEntity := IASTProgramFile new
filename: './main.f' ;
body: { iastEntity } ;
yourself.
importer iastModel: { iastEntity }.

importer iASTToFamix.

self assert: (importer famixModel allWithType: FamixF77ProgramFile) size equals: 1.

fmxEntity := (importer famixModel allWithType: FamixF77ProgramFile) anyOne.
self assert: fmxEntity programUnits size equals: 1.

fmxEntity := fmxEntity programUnits first.
self assert: fmxEntity class equals: FamixF77PUFunction.
self assert: fmxEntity name equals: 'fct'.
self assert: fmxEntity programFile isNotNil.

self assert: fmxEntity parameters size equals: 1.
param := fmxEntity parameters first.
self assert: param class equals: FamixF77Parameter.
self assert: param name equals: 'var'.
self assert: param parentBehaviouralEntity equals: fmxEntity.
]

{ #category : #'tests - import steps' }
FortranProjectImporterTest >> testIncludedFilesToEsope [

Expand Down

0 comments on commit cb8fe5f

Please sign in to comment.