Skip to content

Commit

Permalink
Better test for Reference to undefined figure file
Browse files Browse the repository at this point in the history
  • Loading branch information
Ducasse committed Oct 29, 2024
1 parent 82eafe5 commit 6907fd8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Microdown-BookTester-Tests/MicReferenceCheckerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -660,15 +660,19 @@ MicReferenceCheckerTest >> testDuplicatedMaths [
{ #category : 'tests - single file' }
MicReferenceCheckerTest >> testFigureFilePathToUnkFile [

| visitor |
| visitor refToUnexistingFiles |
visitor := MicReferenceChecker new.
visitor rootDirectory: dir.
visitor checkProject: self defFig1FilePathToUnk.
self deny: visitor isOkay.
self assert: visitor results size equals: 2.
self assert: visitor results first what equals: 'figures/f.png'.
refToUnexistingFiles := (visitor results groupedBy: [ :each | each class name ]) at: #MicUndefinedFigureFileResult.
self assert: refToUnexistingFiles size equals: 1.
self assert: refToUnexistingFiles first what equals: 'figures/f.png'.
self assert: refToUnexistingFiles first figureFileString equals: 'figures/f.png'.

self
assert: visitor results first sourceFileReference fullName
assert: refToUnexistingFiles first sourceFileReference fullName
equals: '/myDirectory/defAndRefFig1.md'
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ MicUndefinedFigureFileResult >> explanation [

]

{ #category : 'accessing' }
MicUndefinedFigureFileResult >> figureFileString [

^ figureFileString
]

{ #category : 'accessing' }
MicUndefinedFigureFileResult >> figureFileString: aString [

Expand Down

0 comments on commit 6907fd8

Please sign in to comment.