-
Notifications
You must be signed in to change notification settings - Fork 46
Add new checker MicSecondaryRoot #1100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
38f7136
Add new checker MicSecondaryRoot
AntoineUsal a877e92
Merge 9a9b54d2a1cd628f6298d52d3768ae2864399676
AntoineUsal 75b1c25
Update MicSecondaryRoot
AntoineUsal 73ad69c
Remove file:
AntoineUsal 74b1d71
Merge 1fd27c61c45e2a99494335765097fa97023a45ad
AntoineUsal 70bfdf1
fix broken tests
AntoineUsal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| Class { | ||
| #name : 'MicSecondaryRootBlockTest', | ||
| #superclass : 'TestCase', | ||
| #category : 'Microdown-Tests-Model', | ||
| #package : 'Microdown-Tests', | ||
| #tag : 'Model' | ||
| } | ||
|
|
||
| { #category : 'tests' } | ||
| MicSecondaryRootBlockTest >> testAcceptDoubleDispatch [ | ||
|
|
||
| | block visitor | | ||
| block := MicSecondaryRootBlock new. | ||
| visitor := MicrodownVisitor new. | ||
| self shouldnt: [ block accept: visitor ] raise: Error | ||
| ] | ||
|
|
||
| { #category : 'tests' } | ||
| MicSecondaryRootBlockTest >> testCanHoldChildren [ | ||
|
|
||
| | root child | | ||
| root := MicSecondaryRootBlock new. | ||
| child := MicParagraphBlock new. | ||
|
|
||
| root addChild: child. | ||
|
|
||
| self assert: root children size equals: 1. | ||
| self assert: root children first equals: child | ||
| ] | ||
|
|
||
| { #category : 'tests' } | ||
| MicSecondaryRootBlockTest >> testFileProperty [ | ||
|
|
||
| | root fileRef | | ||
| root := MicSecondaryRootBlock new. | ||
| fileRef := 'fichierInclus.md'. | ||
|
|
||
| root file: fileRef. | ||
|
|
||
| self assert: root file equals: fileRef | ||
| ] | ||
|
|
||
| { #category : 'tests' } | ||
| MicSecondaryRootBlockTest >> testIsSecondaryRoot [ | ||
|
|
||
| | mainRoot secondaryRoot | | ||
| mainRoot := MicRootBlock new. | ||
| secondaryRoot := MicSecondaryRootBlock new. | ||
|
|
||
| self deny: mainRoot isSecondaryRoot. | ||
|
|
||
| secondaryRoot parent: mainRoot. | ||
|
|
||
| self assert: secondaryRoot isSecondaryRoot | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| Class { | ||
| #name : 'MicSecondaryRootBlock', | ||
| #superclass : 'MicRootBlock', | ||
| #instVars : [ | ||
| 'file' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you look in the superclass fromFile is already defined so |
||
| ], | ||
| #category : 'Microdown-Model', | ||
| #package : 'Microdown', | ||
| #tag : 'Model' | ||
| } | ||
|
|
||
| { #category : 'testing' } | ||
| MicSecondaryRootBlock >> accept: aVisitor [ | ||
|
|
||
| ^ aVisitor visitSecondaryRootBlock: self | ||
| ] | ||
|
|
||
| { #category : 'testing' } | ||
| MicSecondaryRootBlock >> file [ | ||
|
|
||
| ^ file | ||
| ] | ||
|
|
||
| { #category : 'testing' } | ||
| MicSecondaryRootBlock >> file: aFileReference [ | ||
|
|
||
| file := aFileReference | ||
| ] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be smarter. I wonder. Because a main root block parent is nil while by construction a secondaryRootBlock should be nested into something.