Skip to content

Commit

Permalink
Merge branch 'fix/testcases' of https://github.com/hpi-swa-teaching/M…
Browse files Browse the repository at this point in the history
…arkdownEditor.git into fix/testcases
  • Loading branch information
Marie Fischer committed Aug 5, 2021
2 parents d81623f + bc6e7d5 commit 36218c4
Show file tree
Hide file tree
Showing 19 changed files with 220 additions and 98 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
styling
styleListItemWith: aMarkdownList
styleListItemWith: aMarkdownListItem

self text
addAllAttributes: (aMarkdownList textAttributes)
from: (aMarkdownList startPosition)
to: (aMarkdownList endPosition).
aMarkdownList children
addAllAttributes: (aMarkdownListItem textAttributes)
from: (aMarkdownListItem startPosition)
to: (aMarkdownListItem endPosition).
aMarkdownListItem children
do: [:child | child applyStylingWith: self]

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"styleInlineContainerWith:" : "jh 7/22/2021 11:48",
"styleInlinesOf:" : "jh 7/26/2021 12:46",
"styleLeafBlockWith:" : "jh 8/2/2021 11:02",
"styleListItemWith:" : "jh 7/27/2021 16:37",
"styleListItemWith:" : "jh 8/5/2021 19:12",
"text" : "jh 7/6/2021 22:12",
"text:" : "jh 7/6/2021 22:12",
"textRunsFrom:to:" : "jh 7/15/2021 12:30" } }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
html
convertWith: anHtmlConverter

^self htmlOpeningTag, self code, self htmlClosingTag
^ self htmlOpeningTag, self code, self htmlClosingTag
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"applyStylingWith:" : "jh 8/5/2021 13:31",
"code" : "jh 7/28/2021 16:06",
"code:" : "jh 7/28/2021 16:07",
"convertWith:" : "jh 7/28/2021 16:06",
"convertWith:" : "jh 8/5/2021 17:50",
"extractString" : "jh 7/28/2021 16:24",
"fenceLength" : "jh 7/26/2021 10:51",
"fenceLength:" : "jh 7/26/2021 10:51",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ comparing
self class = anotherDelimiter class
ifFalse: [^ false].
^ (self compareState: anotherDelimiter)
and: [self comparePotentialOpenerAndCloser: anotherDelimiter]
and: [self compareOpenClosingProperty: anotherDelimiter]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comparing
comparePotentialOpenerAndCloser: anotherDelimiter
compareOpenClosingProperty: anotherDelimiter

^ self isPotentialOpener = anotherDelimiter isPotentialOpener
and: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"class" : {
"newFromPadded:" : "jh 7/6/2021 22:33" },
"instance" : {
"=" : "JE 7/31/2021 11:39",
"=" : "jh 8/5/2021 17:49",
"asMarkdownString" : "jh 7/24/2021 14:41",
"beInvalid" : "jh 6/24/2021 14:51",
"beNotOriginalOpenerAndCloser" : "jh 6/24/2021 14:52",
Expand All @@ -12,7 +12,7 @@
"bePotentialCloser" : "mf 6/10/2021 14:35",
"bePotentialOpener" : "jh 6/11/2021 07:30",
"beValid" : "jh 6/12/2021 12:57",
"comparePotentialOpenerAndCloser:" : "mf 7/28/2021 23:30",
"compareOpenClosingProperty:" : "jh 8/5/2021 17:49",
"compareState:" : "mf 7/29/2021 02:13",
"count" : "jh 6/9/2021 16:07",
"count:" : "mf 6/10/2021 12:42",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
tests - lists
testListItemSpaces3
"i dont get why this is failing"

| document list output blockquote listItem paragraph paragraph2 blockquote2 |
output := parser parse: ' > > 1. one', Character cr, '>>', Character cr, '>> two'.
list := MarkdownList new.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tests - lists
testParseList2
testParseList02

| output document list listItem paragraph listItem2 listItem3 paragraph3 code |
output := parser parse: '-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tests - lists
testParseList3
testParseList03

| output document list listItem paragraph |
output := parser parse: '-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tests - lists
testParseList4
testParseList04

| output document list listItem paragraph listItem2 listItem3 paragraph3 |
output := parser parse: '- foo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tests - lists
testParseList5
testParseList05

| output document list listItem paragraph listItem2 listItem3 paragraph3 |
output := parser parse: '1. foo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tests - lists
testParseList6
testParseList06

| output document list listItem paragraph |
output := parser parse: ' 1. A paragraph
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tests - lists
testParseList7
testParseList07

| output document list listItem paragraph blockquote blockquote2 |
output := parser parse: '> 1. > Blockquote
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tests - lists
testParseList8
testParseList08

| output document list listItem paragraph blockquote blockquote2 |
output := parser parse: '> 1. > Blockquote
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
tests - lists
testParseList09

| output document list listItem paragraph listItem2 listItem3 paragraph2 paragraph3 paragraph4 listItem4 |
output := parser parse: '- foo
- bar
- baz
- boo'.
list := MarkdownList new.
listItem := MarkdownListItem new.
listItem2 := MarkdownListItem new.
listItem3 := MarkdownListItem new.
listItem4 := MarkdownListItem new.
paragraph := MarkdownParagraph new.
paragraph2 := MarkdownParagraph new.
paragraph3 := MarkdownParagraph new.
paragraph4 := MarkdownParagraph new.
document := MarkdownDocument new
startPosition: 1;
endPosition: 29;
beClosed;
children: (OrderedCollection newFrom: {list});
yourself.
list
container: document;
startPosition: 1;
endPosition: 29;
beClosed;
children: (OrderedCollection newFrom: {listItem. listItem2. listItem3. listItem4});
indentation: 5;
listMarker: '-';
beUnordered.
listItem
container: list;
startPosition: 1;
endPosition: 6;
innerLine: 'foo', Character cr;
beClosed;
children: (OrderedCollection newFrom: {paragraph});
beUnordered;
listMarker: '-';
indentation: 2.
paragraph
container: listItem;
startPosition: 3;
endPosition: 6;
innerStartPosition: 3;
content: 'foo';
beClosed;
inlineElements: (MarkdownLinkedList newFrom:
{MarkdownString newFrom: 'foo' startingAt: 3}).
listItem2
container: list;
startPosition: 7;
endPosition: 13;
innerLine: 'bar', Character cr;
beClosed;
children: (OrderedCollection newFrom: {paragraph2});
beUnordered;
listMarker: '-';
indentation: 3.
paragraph2
container: listItem2;
startPosition: 10;
endPosition: 13;
innerStartPosition: 10;
content: 'bar';
beClosed;
inlineElements: (MarkdownLinkedList newFrom:
{MarkdownString newFrom: 'bar' startingAt: 10}).
listItem3
container: list;
startPosition: 14;
endPosition: 21;
innerLine: 'baz', Character cr;
beClosed;
children: (OrderedCollection newFrom: {paragraph3});
beUnordered;
listMarker: '-';
indentation: 4.
paragraph3
container: listItem3;
startPosition: 18;
endPosition: 21;
innerStartPosition: 18;
content: 'baz';
beClosed;
inlineElements: (MarkdownLinkedList newFrom:
{MarkdownString newFrom: 'baz' startingAt: 18}).
listItem4
container: list;
startPosition: 22;
endPosition: 29;
innerLine: 'boo';
beClosed;
children: (OrderedCollection newFrom: {paragraph4});
beUnordered;
listMarker: '-';
indentation: 5.
paragraph4
container: listItem4;
startPosition: 27;
endPosition: 29;
innerStartPosition: 27;
content: 'boo';
beClosed;
inlineElements: (MarkdownLinkedList newFrom:
{MarkdownString newFrom: 'boo' startingAt: 27}).

self assert: document equals: output
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
tests - lists
testParseList10

| output document list listItem paragraph listItem2 listItem3 paragraph3 |
output := parser parse: '1. foo
2.
3. bar'.
list := MarkdownList new.
listItem := MarkdownListItem new.
listItem2 := MarkdownListItem new.
listItem3 := MarkdownListItem new.
paragraph := MarkdownParagraph new.
paragraph3 := MarkdownParagraph new.
document := MarkdownDocument new
startPosition: 1;
endPosition: 16;
beClosed;
children: (OrderedCollection newFrom: {list});
yourself.
list
container: document;
startPosition: 1;
endPosition: 16;
beClosed;
children: (OrderedCollection newFrom: {listItem. listItem2. listItem3});
indentation: 3;
listMarker: '.';
startNumber: 1;
beOrdered.
listItem
container: list;
startPosition: 1;
endPosition: 7;
innerLine: 'foo', Character cr;
beClosed;
children: (OrderedCollection newFrom: {paragraph});
beOrdered;
listMarker: '.';
indentation: 3;
number: 1.
paragraph
container: listItem;
startPosition: 4;
endPosition: 7;
innerStartPosition: 4;
content: 'foo';
beClosed;
inlineElements: (MarkdownLinkedList newFrom:
{MarkdownString newFrom: 'foo' startingAt: 4}).
listItem2
container: list;
startPosition: 8;
endPosition: 10;
innerLine: '';
beClosed;
beOrdered;
listMarker: '.';
indentation: 3;
number: 2.
listItem3
container: list;
startPosition: 11;
endPosition: 16;
innerLine: 'bar';
beClosed;
children: (OrderedCollection newFrom: {paragraph3});
beOrdered;
listMarker: '.';
indentation: 3;
number: 3.
paragraph3
container: listItem;
startPosition: 14;
endPosition: 16;
innerStartPosition: 14;
content: 'bar';
beClosed;
inlineElements: (MarkdownLinkedList newFrom:
{MarkdownString newFrom: 'bar' startingAt: 14}).
self assert: document equals: output

This file was deleted.

Loading

0 comments on commit 36218c4

Please sign in to comment.