Skip to content

Commit

Permalink
fix broken test of MicAnnotatedParagraphBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
quentin.moutte.etu committed Aug 23, 2024
1 parent 6b66ac7 commit 16b8ea3
Showing 1 changed file with 39 additions and 7 deletions.
46 changes: 39 additions & 7 deletions src/Microdown-Tests/MicAnnotatedParagraphBlockTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ MicAnnotatedParagraphBlockTest >> subjectClass [
MicAnnotatedParagraphBlockTest >> testBasicAnnotetedParagraph [

| root annotatedParagraph |
root := parser parse: '!!important This is an important information'.
root := parser parse: '>[! important ]
> This is an important information'.
self assert: root children size equals: 1.
annotatedParagraph := root children first.
self
Expand All @@ -25,12 +26,39 @@ MicAnnotatedParagraphBlockTest >> testBasicAnnotetedParagraph [
equals: 'This is an important information'
]

{ #category : 'tests' }
MicAnnotatedParagraphBlockTest >> testBasicAnnotetedParagraphIgnoreExtraTextInFirstLine [

| root annotatedParagraph |
root := parser parse: '>[! important ] This is an important information
> This is an other information'.
self assert: root children size equals: 1.
annotatedParagraph := root children first.
self
assert: (annotatedParagraph isKindOf: MicAnnotatedParagraphBlock);
assert: annotatedParagraph label equals: 'important';
assert: annotatedParagraph text
equals: 'This is an other information'
]

{ #category : 'tests' }
MicAnnotatedParagraphBlockTest >> testBasicAnnotetedParagraphWhitoutClosingBracket [

| root annotatedParagraph |
root := parser parse: '>[! important
> This is an important information'.
self assert: root children size equals: 1.
annotatedParagraph := root children first.
self
assert: (annotatedParagraph isKindOf: MicBlockQuoteBlock)
]

{ #category : 'tests' }
MicAnnotatedParagraphBlockTest >> testBasicAnnotetedParagraphWithALineBreak [

| root annotatedParagraph |
root := parser parse: '!!important
This is an important information'.
root := parser parse: '>[! important ]
> This is an important information'.
self assert: root children size equals: 1.
annotatedParagraph := root children first.
self
Expand All @@ -44,7 +72,8 @@ This is an important information'.
MicAnnotatedParagraphBlockTest >> testBasicAnnotetedParagraphWithANonSupportedLabel [

| root annotatedParagraph |
root := parser parse: '!!test This is an important information'.
root := parser parse: '>[! test ]
> This is an important information'.
self assert: root children size equals: 1.
annotatedParagraph := root children first.
self
Expand All @@ -58,7 +87,8 @@ MicAnnotatedParagraphBlockTest >> testBasicAnnotetedParagraphWithANonSupportedLa
MicAnnotatedParagraphBlockTest >> testBasicAnnotetedParagraphWithANonSupportedLabelWithUpperCase [

| root annotatedParagraph |
root := parser parse: '!!Test This is an important information'.
root := parser parse: '>[! Test ]
> This is an important information'.
self assert: root children size equals: 1.
annotatedParagraph := root children first.
self
Expand All @@ -73,7 +103,8 @@ MicAnnotatedParagraphBlockTest >> testBasicAnnotetedParagraphWithBlodText [

| root annotatedParagraph |
root := parser parse:
'!!important This is an **important** information'.
'>[! important ]
> This is an **important** information'.
self assert: root children size equals: 1.
annotatedParagraph := root children first.
self
Expand All @@ -91,7 +122,8 @@ MicAnnotatedParagraphBlockTest >> testBasicAnnotetedParagraphWithBlodText [
MicAnnotatedParagraphBlockTest >> testBasicAnnotetedParagraphWithLabelHavingUpperCase [

| root annotatedParagraph |
root := parser parse: '!!ImporTanT This is an important information'.
root := parser parse: '>[! ImporTanT ]
> This is an important information'.
self assert: root children size equals: 1.
annotatedParagraph := root children first.
self
Expand Down

0 comments on commit 16b8ea3

Please sign in to comment.