Skip to content

Commit

Permalink
change testDuplicatedAnchorInDifferentFilesOfTheSameDir for test all …
Browse files Browse the repository at this point in the history
…the files in the visitor result with a includesAll:
  • Loading branch information
quentin.moutte.etu committed Oct 7, 2024
1 parent 7d893ed commit 2838ead
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/Microdown-BookTester-Tests/MicReferenceCheckerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ MicReferenceCheckerTest >> testDuplicatedAnchorDir [
{ #category : 'tests - directory api' }
MicReferenceCheckerTest >> testDuplicatedAnchorInDifferentFilesOfTheSameDir [

| file1 file2 visitor dict original duplicated |
| file1 file2 visitor dict original duplicated resultFullName |
file1 := dir / 'file1.md'.
file1 writeStreamDo: [ :stream |
stream nextPutAll: '# Section
Expand Down Expand Up @@ -498,18 +498,16 @@ MicReferenceCheckerTest >> testDuplicatedAnchorInDifferentFilesOfTheSameDir [
assert: visitor duplicatedAnchors first anchorLabel
equals: 'ancS1'.
dict := visitor results groupedBy: [ :each | each class ].

original := (dict at: MicDuplicatedAnchorResult) first.
self
assert: visitor results first sourceFileReference fullName
equals: '/myDirectory/file1.md'.
self assert: original anchorLabel equals: 'ancS1'.

duplicated := (dict at: MicDuplicatedAnchorResult) second.
self
assert: visitor results second sourceFileReference fullName
equals: '/myDirectory/file2.md'.
self assert: duplicated anchorLabel equals: 'ancS1'
self assert: duplicated anchorLabel equals: 'ancS1'.

resultFullName := visitor results collect: [ :each | each sourceFileReference fullName ].
self
assert: (resultFullName includesAll: #('/myDirectory/file1.md' '/myDirectory/file2.md' ))
]

{ #category : 'tests - duplicated' }
Expand Down

0 comments on commit 2838ead

Please sign in to comment.