From d083cb4a4e9dca931eda10d7d7b7ea61366bea48 Mon Sep 17 00:00:00 2001 From: "quentin.moutte.etu" Date: Thu, 22 Aug 2024 22:00:49 +0200 Subject: [PATCH 1/5] add test for ston format in MicResult --- .../MicReferenceCheckerTest.class.st | 37 +++++++++++++++++++ .../MicResultTest.class.st | 32 ++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/src/Microdown-BookTester-Tests/MicReferenceCheckerTest.class.st b/src/Microdown-BookTester-Tests/MicReferenceCheckerTest.class.st index 561af919..d072dddf 100644 --- a/src/Microdown-BookTester-Tests/MicReferenceCheckerTest.class.st +++ b/src/Microdown-BookTester-Tests/MicReferenceCheckerTest.class.st @@ -702,6 +702,43 @@ MicReferenceCheckerTest >> testRefersToUnkAncS1 [ self assert: visitor results first source equals: '/fileRefAncS1.md' ] +{ #category : 'tests - duplicated' } +MicReferenceCheckerTest >> testReportingSTONFormatDuplicatedAnchors [ + + | defAncS0TripleAncS1RefAncS1AncS0 checker | + defAncS0TripleAncS1RefAncS1AncS0 := self defAncS0TripleAncS1RefAncS1AncS0. + checker := MicReferenceChecker new. + checker checkList: { defAncS0TripleAncS1RefAncS1AncS0 }. + + self assert: checker reportSTONFormat equals: ' +{ "type" : "DuplicatedAnchor", +[ + "ancS1" : "/myDirectory/defAncS0TripleAncS1RefAncS1AncS0.md", + "ancS1" : "/myDirectory/defAncS0TripleAncS1RefAncS1AncS0.md"]} + +' + + +] + +{ #category : 'tests - duplicated' } +MicReferenceCheckerTest >> testReportingSTONFormatUnknownAnchorDir [ + + | checker | + self fileRefAncS1. + checker := MicReferenceChecker new. + checker rootDirectory: dir. + checker checkProject: refAncS1. + + self assert: checker reportSTONFormat equals: ' +{ "type" : "UndefinedAnchor", +[ + "ancS1" : "/fileRefAncS1.md"]} + +' + +] + { #category : 'skipped for now' } MicReferenceCheckerTest >> testReportingUnknownAnchorDir [ diff --git a/src/Microdown-BookTester-Tests/MicResultTest.class.st b/src/Microdown-BookTester-Tests/MicResultTest.class.st index e5650aef..33d1e720 100644 --- a/src/Microdown-BookTester-Tests/MicResultTest.class.st +++ b/src/Microdown-BookTester-Tests/MicResultTest.class.st @@ -37,6 +37,38 @@ MicResultTest >> testExplanationUndefinedAnchor [ ] +{ #category : 'tests' } +MicResultTest >> testSTONFormatExplanationDuplicatedAnchor [ + + | res | + res := MicDuplicatedAnchorResult new. + res anchorLabel: 'ancS0'. + "pay attention since in this package fromFile is pass a fullName and not a file we will have to change + this later" + res source: '/myDir/chapter1.md'. + + self + assert: res StonFormatExplanation + equals: '"ancS0" : "/myDir/chapter1.md"' + +] + +{ #category : 'tests' } +MicResultTest >> testSTONFormatExplanationUndefinedAnchor [ + + | res | + res := MicUndefinedAnchorResult new. + res anchorLabel: 'ancS0'. + "pay attention since in this package fromFile is pass a fullName and not a file we will have to change + this later" + res source: '/myDir/chapter1.md'. + + self + assert: res StonFormatExplanation + equals: '"ancS0" : "/myDir/chapter1.md"' + +] + { #category : 'tests' } MicResultTest >> testUndefinedFigureFile [ From 44f11c27825da8239a4f1efc4bb95447fa70515d Mon Sep 17 00:00:00 2001 From: "quentin.moutte.etu" Date: Thu, 22 Aug 2024 22:01:46 +0200 Subject: [PATCH 2/5] add STON format for error explanation of MicResult --- .../MicAnchorResult.class.st | 13 +++++++++ .../MicBookTestResult.class.st | 23 +++++++++++++++ .../MicDuplicatedAnchorResult.class.st | 6 ++++ .../MicFileResult.class.st | 7 +++++ .../MicReferenceChecker.class.st | 28 +++++++++++++++++++ src/Microdown-BookTester/MicResult.class.st | 12 ++++++++ .../MicUndefinedAnchorResult.class.st | 6 ++++ .../MicUndefinedFigureFileResult.class.st | 6 ++++ .../MicUndefinedInputFileResult.class.st | 6 ++++ 9 files changed, 107 insertions(+) diff --git a/src/Microdown-BookTester/MicAnchorResult.class.st b/src/Microdown-BookTester/MicAnchorResult.class.st index 2c8cfad6..3639d6ec 100644 --- a/src/Microdown-BookTester/MicAnchorResult.class.st +++ b/src/Microdown-BookTester/MicAnchorResult.class.st @@ -8,6 +8,19 @@ Class { #package : 'Microdown-BookTester' } +{ #category : 'kinds' } +MicAnchorResult class >> errorType [ + + ^ 'UndefinedAnchor' +] + +{ #category : 'accessing' } +MicAnchorResult >> StonFormatExplanation [ + + ^ '"', anchorLabel , '" : "', source,'"' + +] + { #category : 'accessing' } MicAnchorResult >> anchorLabel [ diff --git a/src/Microdown-BookTester/MicBookTestResult.class.st b/src/Microdown-BookTester/MicBookTestResult.class.st index ab924a0f..2156351a 100644 --- a/src/Microdown-BookTester/MicBookTestResult.class.st +++ b/src/Microdown-BookTester/MicBookTestResult.class.st @@ -141,6 +141,29 @@ MicBookTestResult >> isValid [ ^ status ] +{ #category : 'accessing' } +MicBookTestResult >> stonFormatExplanation [ + + ^ '{', String cr , '"status" : "', + (self class allMessages at: self status asString) asString ,'",', + String cr , + '"isExpectedFailure" : "', + self isExpectedFailure asString ,'",', + String cr , + '"Description" : "' , + self message asString ,'",', + String cr , + '"codeBlock" : "', + self text , '",', + String cr , + '"sourceFile" : "' , + self source asString , '"', + String cr , '}' + + + +] + { #category : 'accessing' } MicBookTestResult >> text [ diff --git a/src/Microdown-BookTester/MicDuplicatedAnchorResult.class.st b/src/Microdown-BookTester/MicDuplicatedAnchorResult.class.st index 29c91f98..b9ccfb27 100644 --- a/src/Microdown-BookTester/MicDuplicatedAnchorResult.class.st +++ b/src/Microdown-BookTester/MicDuplicatedAnchorResult.class.st @@ -5,6 +5,12 @@ Class { #package : 'Microdown-BookTester' } +{ #category : 'kinds' } +MicDuplicatedAnchorResult class >> errorType [ + + ^ 'DuplicatedAnchor' +] + { #category : 'kinds' } MicDuplicatedAnchorResult class >> headerString [ diff --git a/src/Microdown-BookTester/MicFileResult.class.st b/src/Microdown-BookTester/MicFileResult.class.st index dbd80f7f..21b6da25 100644 --- a/src/Microdown-BookTester/MicFileResult.class.st +++ b/src/Microdown-BookTester/MicFileResult.class.st @@ -5,6 +5,13 @@ Class { #package : 'Microdown-BookTester' } +{ #category : 'accessing' } +MicFileResult >> StonFormatExplanation [ + + ^ '"', self what,'" : "', source , '"' + +] + { #category : 'accessing' } MicFileResult >> explanation [ diff --git a/src/Microdown-BookTester/MicReferenceChecker.class.st b/src/Microdown-BookTester/MicReferenceChecker.class.st index 96d725aa..f57c77a3 100644 --- a/src/Microdown-BookTester/MicReferenceChecker.class.st +++ b/src/Microdown-BookTester/MicReferenceChecker.class.st @@ -57,6 +57,7 @@ MicReferenceChecker >> addDuplicatedAnchor: anAnchor [ MicReferenceChecker >> buildReportOn: str [ | dict | + dict := results groupedBy: [ :each | each class ]. dict keysAndValuesDo: [ :k :v | str cr; nextPutAll: '## ' ;nextPutAll: k headerString; cr; cr. @@ -65,6 +66,18 @@ MicReferenceChecker >> buildReportOn: str [ ] ] +{ #category : 'reporting' } +MicReferenceChecker >> buildReportSTONFormatOn: str [ + + | dict | + dict := results groupedBy: [ :each | each class ]. + dict keysAndValuesDo: [ :k :v | + str cr; nextPutAll: '{ "type" : "' ;nextPutAll: k errorType; nextPutAll: '",'; cr ;nextPutAll: '[ '; cr. + self reportElementsSTONFormatOn: str. + str nextPutAll:']}'; cr; cr. + ] +] + { #category : 'main API' } MicReferenceChecker >> checkDirectory: aDir [ "Take the directory, parse all its children with microdown file parser and let the visitor visit each time then return visitor is ok which should be true if every thing is okay, the visitor turned out to treat the many documents that it visits as one, so if anchor is duplicated in another file it will detect that . " @@ -197,6 +210,21 @@ MicReferenceChecker >> reportElementsOn: aStream [ ] +{ #category : 'reporting' } +MicReferenceChecker >> reportElementsSTONFormatOn: aStream [ + + results do: [ :each | aStream tab; nextPutAll: each StonFormatExplanation ] separatedBy: [ aStream nextPut: $, ; cr ] + +] + +{ #category : 'reporting' } +MicReferenceChecker >> reportSTONFormat [ + + ^ String streamContents: [ :str | + self buildReportSTONFormatOn: str + ] +] + { #category : 'accessing' } MicReferenceChecker >> results [ diff --git a/src/Microdown-BookTester/MicResult.class.st b/src/Microdown-BookTester/MicResult.class.st index 99c8f08b..fe96ebb9 100644 --- a/src/Microdown-BookTester/MicResult.class.st +++ b/src/Microdown-BookTester/MicResult.class.st @@ -23,12 +23,24 @@ Class { #package : 'Microdown-BookTester' } +{ #category : 'kinds' } +MicResult class >> errorType [ + + ^ self subclassResponsibility +] + { #category : 'kinds' } MicResult class >> headerString [ ^ self subclassResponsibility ] +{ #category : 'accessing' } +MicResult >> StonFormatExplanation [ + + ^ self subclassResponsibility +] + { #category : 'accessing' } MicResult >> explanation [ diff --git a/src/Microdown-BookTester/MicUndefinedAnchorResult.class.st b/src/Microdown-BookTester/MicUndefinedAnchorResult.class.st index 2d09e914..ef46c28a 100644 --- a/src/Microdown-BookTester/MicUndefinedAnchorResult.class.st +++ b/src/Microdown-BookTester/MicUndefinedAnchorResult.class.st @@ -5,6 +5,12 @@ Class { #package : 'Microdown-BookTester' } +{ #category : 'kinds' } +MicUndefinedAnchorResult class >> errorType [ + + ^ 'UndefinedAnchor' +] + { #category : 'kinds' } MicUndefinedAnchorResult class >> headerString [ diff --git a/src/Microdown-BookTester/MicUndefinedFigureFileResult.class.st b/src/Microdown-BookTester/MicUndefinedFigureFileResult.class.st index bac5e8e2..4bdfaf66 100644 --- a/src/Microdown-BookTester/MicUndefinedFigureFileResult.class.st +++ b/src/Microdown-BookTester/MicUndefinedFigureFileResult.class.st @@ -8,6 +8,12 @@ Class { #package : 'Microdown-BookTester' } +{ #category : 'kinds' } +MicUndefinedFigureFileResult class >> errorType [ + + ^ 'UndefinedFigureFiles:' +] + { #category : 'kinds' } MicUndefinedFigureFileResult class >> headerString [ diff --git a/src/Microdown-BookTester/MicUndefinedInputFileResult.class.st b/src/Microdown-BookTester/MicUndefinedInputFileResult.class.st index 170a435e..7e389538 100644 --- a/src/Microdown-BookTester/MicUndefinedInputFileResult.class.st +++ b/src/Microdown-BookTester/MicUndefinedInputFileResult.class.st @@ -8,6 +8,12 @@ Class { #package : 'Microdown-BookTester' } +{ #category : 'kinds' } +MicUndefinedInputFileResult class >> errorType [ + + ^ 'UndefinedInputFiles' +] + { #category : 'kinds' } MicUndefinedInputFileResult class >> headerString [ From 4324299c3f9ab4c9ddc1f14e4a11a6df5fc19142 Mon Sep 17 00:00:00 2001 From: "quentin.moutte.etu" Date: Thu, 22 Aug 2024 22:06:53 +0200 Subject: [PATCH 3/5] Rename StonFormatExplanation to stonFormatExplanation --- .../MicReferenceCheckerTest.class.st | 17 +++++++++++++++++ .../MicResultTest.class.st | 4 ++-- .../MicAnchorResult.class.st | 14 +++++++------- src/Microdown-BookTester/MicFileResult.class.st | 8 ++++---- .../MicReferenceChecker.class.st | 2 +- src/Microdown-BookTester/MicResult.class.st | 12 ++++++------ 6 files changed, 37 insertions(+), 20 deletions(-) diff --git a/src/Microdown-BookTester-Tests/MicReferenceCheckerTest.class.st b/src/Microdown-BookTester-Tests/MicReferenceCheckerTest.class.st index d072dddf..9190bc56 100644 --- a/src/Microdown-BookTester-Tests/MicReferenceCheckerTest.class.st +++ b/src/Microdown-BookTester-Tests/MicReferenceCheckerTest.class.st @@ -721,6 +721,23 @@ MicReferenceCheckerTest >> testReportingSTONFormatDuplicatedAnchors [ ] +{ #category : 'tests - duplicated' } +MicReferenceCheckerTest >> testReportingSTONFormatDuplicatedFigure [ + + | checker | + self fileRefAncS1. + checker := MicReferenceChecker new. + checker rootDirectory: dir. + checker checkProject: refAncS1. + + self assert: checker reportSTONFormat equals: ' +{ "type" : "UndefinedAnchor", +[ + "ancS1" : "/fileRefAncS1.md"]} + +' +] + { #category : 'tests - duplicated' } MicReferenceCheckerTest >> testReportingSTONFormatUnknownAnchorDir [ diff --git a/src/Microdown-BookTester-Tests/MicResultTest.class.st b/src/Microdown-BookTester-Tests/MicResultTest.class.st index 33d1e720..4e6e8ab3 100644 --- a/src/Microdown-BookTester-Tests/MicResultTest.class.st +++ b/src/Microdown-BookTester-Tests/MicResultTest.class.st @@ -48,7 +48,7 @@ MicResultTest >> testSTONFormatExplanationDuplicatedAnchor [ res source: '/myDir/chapter1.md'. self - assert: res StonFormatExplanation + assert: res stonFormatExplanation equals: '"ancS0" : "/myDir/chapter1.md"' ] @@ -64,7 +64,7 @@ MicResultTest >> testSTONFormatExplanationUndefinedAnchor [ res source: '/myDir/chapter1.md'. self - assert: res StonFormatExplanation + assert: res stonFormatExplanation equals: '"ancS0" : "/myDir/chapter1.md"' ] diff --git a/src/Microdown-BookTester/MicAnchorResult.class.st b/src/Microdown-BookTester/MicAnchorResult.class.st index 3639d6ec..a713539d 100644 --- a/src/Microdown-BookTester/MicAnchorResult.class.st +++ b/src/Microdown-BookTester/MicAnchorResult.class.st @@ -14,13 +14,6 @@ MicAnchorResult class >> errorType [ ^ 'UndefinedAnchor' ] -{ #category : 'accessing' } -MicAnchorResult >> StonFormatExplanation [ - - ^ '"', anchorLabel , '" : "', source,'"' - -] - { #category : 'accessing' } MicAnchorResult >> anchorLabel [ @@ -44,3 +37,10 @@ MicAnchorResult >> explanation [ MicAnchorResult >> isWhat [ ^ 'undefined' ] + +{ #category : 'accessing' } +MicAnchorResult >> stonFormatExplanation [ + + ^ '"', anchorLabel , '" : "', source,'"' + +] diff --git a/src/Microdown-BookTester/MicFileResult.class.st b/src/Microdown-BookTester/MicFileResult.class.st index 21b6da25..92f41e9e 100644 --- a/src/Microdown-BookTester/MicFileResult.class.st +++ b/src/Microdown-BookTester/MicFileResult.class.st @@ -6,16 +6,16 @@ Class { } { #category : 'accessing' } -MicFileResult >> StonFormatExplanation [ +MicFileResult >> explanation [ - ^ '"', self what,'" : "', source , '"' + ^ 'File input ', self what,' (in file ', source , ') does not exist' ] { #category : 'accessing' } -MicFileResult >> explanation [ +MicFileResult >> stonFormatExplanation [ - ^ 'File input ', self what,' (in file ', source , ') does not exist' + ^ '"', self what,'" : "', source , '"' ] diff --git a/src/Microdown-BookTester/MicReferenceChecker.class.st b/src/Microdown-BookTester/MicReferenceChecker.class.st index f57c77a3..b2f6a7a0 100644 --- a/src/Microdown-BookTester/MicReferenceChecker.class.st +++ b/src/Microdown-BookTester/MicReferenceChecker.class.st @@ -213,7 +213,7 @@ MicReferenceChecker >> reportElementsOn: aStream [ { #category : 'reporting' } MicReferenceChecker >> reportElementsSTONFormatOn: aStream [ - results do: [ :each | aStream tab; nextPutAll: each StonFormatExplanation ] separatedBy: [ aStream nextPut: $, ; cr ] + results do: [ :each | aStream tab; nextPutAll: each stonFormatExplanation ] separatedBy: [ aStream nextPut: $, ; cr ] ] diff --git a/src/Microdown-BookTester/MicResult.class.st b/src/Microdown-BookTester/MicResult.class.st index fe96ebb9..5426cbc5 100644 --- a/src/Microdown-BookTester/MicResult.class.st +++ b/src/Microdown-BookTester/MicResult.class.st @@ -35,12 +35,6 @@ MicResult class >> headerString [ ^ self subclassResponsibility ] -{ #category : 'accessing' } -MicResult >> StonFormatExplanation [ - - ^ self subclassResponsibility -] - { #category : 'accessing' } MicResult >> explanation [ @@ -82,3 +76,9 @@ MicResult >> status: anObject [ status := anObject ] + +{ #category : 'accessing' } +MicResult >> stonFormatExplanation [ + + ^ self subclassResponsibility +] From 15fdb7536b7c566ad6d5bf4e86644b8e65a2e408 Mon Sep 17 00:00:00 2001 From: "quentin.moutte.etu" Date: Tue, 27 Aug 2024 19:35:24 +0200 Subject: [PATCH 4/5] Change StonFormat of MicResult for use STON class --- .../MicReferenceCheckerTest.class.st | 22 +++---------------- .../MicAnchorResult.class.st | 2 +- .../MicReferenceChecker.class.st | 18 +++++++++------ 3 files changed, 15 insertions(+), 27 deletions(-) diff --git a/src/Microdown-BookTester-Tests/MicReferenceCheckerTest.class.st b/src/Microdown-BookTester-Tests/MicReferenceCheckerTest.class.st index 9190bc56..2a6441eb 100644 --- a/src/Microdown-BookTester-Tests/MicReferenceCheckerTest.class.st +++ b/src/Microdown-BookTester-Tests/MicReferenceCheckerTest.class.st @@ -710,13 +710,7 @@ MicReferenceCheckerTest >> testReportingSTONFormatDuplicatedAnchors [ checker := MicReferenceChecker new. checker checkList: { defAncS0TripleAncS1RefAncS1AncS0 }. - self assert: checker reportSTONFormat equals: ' -{ "type" : "DuplicatedAnchor", -[ - "ancS1" : "/myDirectory/defAncS0TripleAncS1RefAncS1AncS0.md", - "ancS1" : "/myDirectory/defAncS0TripleAncS1RefAncS1AncS0.md"]} - -' + self assert: checker reportSTONFormat equals: '[''type'':''DuplicatedAnchor'',[''ancS1'':''/myDirectory/defAncS0TripleAncS1RefAncS1AncS0.md'',''ancS1'':''/myDirectory/defAncS0TripleAncS1RefAncS1AncS0.md'']]' ] @@ -730,12 +724,7 @@ MicReferenceCheckerTest >> testReportingSTONFormatDuplicatedFigure [ checker rootDirectory: dir. checker checkProject: refAncS1. - self assert: checker reportSTONFormat equals: ' -{ "type" : "UndefinedAnchor", -[ - "ancS1" : "/fileRefAncS1.md"]} - -' + self assert: checker reportSTONFormat equals: '[''type'':''UndefinedAnchor'',[''ancS1'':''/fileRefAncS1.md'']]' ] { #category : 'tests - duplicated' } @@ -747,12 +736,7 @@ MicReferenceCheckerTest >> testReportingSTONFormatUnknownAnchorDir [ checker rootDirectory: dir. checker checkProject: refAncS1. - self assert: checker reportSTONFormat equals: ' -{ "type" : "UndefinedAnchor", -[ - "ancS1" : "/fileRefAncS1.md"]} - -' + self assert: checker reportSTONFormat equals: '[''type'':''UndefinedAnchor'',[''ancS1'':''/fileRefAncS1.md'']]' ] diff --git a/src/Microdown-BookTester/MicAnchorResult.class.st b/src/Microdown-BookTester/MicAnchorResult.class.st index a713539d..d15a28c9 100644 --- a/src/Microdown-BookTester/MicAnchorResult.class.st +++ b/src/Microdown-BookTester/MicAnchorResult.class.st @@ -41,6 +41,6 @@ MicAnchorResult >> isWhat [ { #category : 'accessing' } MicAnchorResult >> stonFormatExplanation [ - ^ '"', anchorLabel , '" : "', source,'"' + ^ Association new key: anchorLabel value: source ] diff --git a/src/Microdown-BookTester/MicReferenceChecker.class.st b/src/Microdown-BookTester/MicReferenceChecker.class.st index b2f6a7a0..2b1506b6 100644 --- a/src/Microdown-BookTester/MicReferenceChecker.class.st +++ b/src/Microdown-BookTester/MicReferenceChecker.class.st @@ -69,12 +69,16 @@ MicReferenceChecker >> buildReportOn: str [ { #category : 'reporting' } MicReferenceChecker >> buildReportSTONFormatOn: str [ - | dict | + | dict list | dict := results groupedBy: [ :each | each class ]. - dict keysAndValuesDo: [ :k :v | - str cr; nextPutAll: '{ "type" : "' ;nextPutAll: k errorType; nextPutAll: '",'; cr ;nextPutAll: '[ '; cr. - self reportElementsSTONFormatOn: str. - str nextPutAll:']}'; cr; cr. + dict keysAndValuesDo: [ :k :v | |array| + array := Array new: 2. + list := OrderedCollection new. + self reportElementsSTONFormatOn: list. + list := list asArray. + array at: 1 put: (Association new key: 'type' value: k errorType); + at: 2 put: list. + (String streamContents: [ :out | STON put: array onStream: str ]) ] ] @@ -211,9 +215,9 @@ MicReferenceChecker >> reportElementsOn: aStream [ ] { #category : 'reporting' } -MicReferenceChecker >> reportElementsSTONFormatOn: aStream [ +MicReferenceChecker >> reportElementsSTONFormatOn: aList [ - results do: [ :each | aStream tab; nextPutAll: each stonFormatExplanation ] separatedBy: [ aStream nextPut: $, ; cr ] + results do: [ :each | aList add: each stonFormatExplanation ]. ] From a8f6552526db26a502a90f0c1a788e6f0c5d9031 Mon Sep 17 00:00:00 2001 From: "quentin.moutte.etu" Date: Tue, 27 Aug 2024 19:40:52 +0200 Subject: [PATCH 5/5] fix MicResult test --- .../MicResultTest.class.st | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Microdown-BookTester-Tests/MicResultTest.class.st b/src/Microdown-BookTester-Tests/MicResultTest.class.st index 4e6e8ab3..73065e4c 100644 --- a/src/Microdown-BookTester-Tests/MicResultTest.class.st +++ b/src/Microdown-BookTester-Tests/MicResultTest.class.st @@ -40,32 +40,38 @@ MicResultTest >> testExplanationUndefinedAnchor [ { #category : 'tests' } MicResultTest >> testSTONFormatExplanationDuplicatedAnchor [ - | res | + | res association | res := MicDuplicatedAnchorResult new. res anchorLabel: 'ancS0'. "pay attention since in this package fromFile is pass a fullName and not a file we will have to change this later" res source: '/myDir/chapter1.md'. + association := res stonFormatExplanation. + self - assert: res stonFormatExplanation - equals: '"ancS0" : "/myDir/chapter1.md"' + assert: (association isKindOf: Association ); + assert: association key equals: 'ancS0'; + assert: association value equals: '/myDir/chapter1.md' ] { #category : 'tests' } MicResultTest >> testSTONFormatExplanationUndefinedAnchor [ - | res | + | res association | res := MicUndefinedAnchorResult new. res anchorLabel: 'ancS0'. "pay attention since in this package fromFile is pass a fullName and not a file we will have to change this later" res source: '/myDir/chapter1.md'. + association := res stonFormatExplanation. + self - assert: res stonFormatExplanation - equals: '"ancS0" : "/myDir/chapter1.md"' + assert: (association isKindOf: Association ); + assert: association key equals: 'ancS0'; + assert: association value equals: '/myDir/chapter1.md' ]