Skip to content

Commit 9c8ca87

Browse files
travkin79Copilot
andcommitted
style: Convert the line endings of the new tests, the reviews and the license to LF
These files were written with CRLF or with both line endings mixed, while the repository uses LF. Nothing but the line endings changes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent a66d9f7 commit 9c8ca87

29 files changed

Lines changed: 1778 additions & 1778 deletions

‎LICENSE.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ Third-party data
3131

3232
flexmark-util-sequence bundles the Unicode Character Database file CaseFolding.txt, version 15.0.0
3333
(https://www.unicode.org/Public/15.0.0/ucd/CaseFolding.txt), unmodified. It is Copyright (c) 1991-2022 Unicode, Inc.
34-
and is licensed under the Unicode License v3 (SPDX: Unicode-3.0), see licenses/UNICODE-LICENSE-V3.txt.
34+
and is licensed under the Unicode License v3 (SPDX: Unicode-3.0), see licenses/UNICODE-LICENSE-V3.txt.

‎analysis-comply-with-commonmark.md‎

Lines changed: 704 additions & 704 deletions
Large diffs are not rendered by default.

‎flexmark-core-test/src/test/java/com/vladsch/flexmark/core/test/util/parser/DirectionalPunctuationTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,4 +258,4 @@ public void formatterRoundTripKeepsTheRenderedOutput() {
258258
assertEquals(md, render(ON, md), render(ON, formatted));
259259
}
260260
}
261-
}
261+
}

‎flexmark-core-test/src/test/java/com/vladsch/flexmark/core/test/util/parser/EmphasisRuleOfThreeTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@ public void originalMotivatingCases() {
7777
assertAll("<p><em><strong>foo</strong> bar</em></p>\n", "***foo** bar*\n");
7878
assertAll("<p><em>foo <strong>bar</strong></em></p>\n", "*foo **bar***\n");
7979
}
80-
}
80+
}

‎flexmark-core-test/src/test/java/com/vladsch/flexmark/core/test/util/parser/FencedCodeInfoStringTest.java‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import org.junit.Test;
1313

1414
import static org.junit.Assert.assertEquals;
15-
import static org.junit.Assert.assertFalse;
15+
import static org.junit.Assert.assertFalse;
1616
import static org.junit.Assert.assertTrue;
1717

1818
/**
@@ -90,7 +90,7 @@ public void formatterKeepsTildeFenceWhenInfoHasBackticksEvenIfBackticksAreReques
9090
assertEquals(TILDE_FENCE_WITH_BACKTICKS_HTML, render(ParserEmulationProfile.COMMONMARK_0_29, formatted));
9191
}
9292
}
93-
94-
95-
96-
93+
94+
95+
96+

‎flexmark-core-test/src/test/java/com/vladsch/flexmark/core/test/util/parser/LinkDestinationPointyBracketsTest.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ public void sourcePositionsAreKeptForDestinationWithSpaceIn029() {
107107

108108
assertSame(document.getChars().getBaseSequence(), link.getUrl().getBaseSequence());
109109
assertEquals("b c", markdown.substring(link.getUrl().getStartOffset(), link.getUrl().getEndOffset()));
110-
}
111-
110+
}
111+
112112
@Test
113113
public void formatterKeepsPointyBracketsOfDestinationWithSpaceIn029() {
114114
DataHolder options = ParserEmulationProfile.COMMONMARK_0_29.getProfileOptions().toImmutable();

‎flexmark-core-test/src/test/java/com/vladsch/flexmark/core/test/util/parser/LinkReferenceDefinitionTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,4 @@ public void formatterRoundTripOfDefinitionsAndSetextHeadingIn029() {
158158
String html = render(ParserEmulationProfile.COMMONMARK_0_29, markdown);
159159
assertEquals(html, render(ParserEmulationProfile.COMMONMARK_0_29, formatted));
160160
}
161-
}
161+
}

‎flexmark-core-test/src/test/java/com/vladsch/flexmark/core/test/util/parser/ListItemIndentTest.java‎

Lines changed: 171 additions & 171 deletions
Large diffs are not rendered by default.
Lines changed: 127 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -1,127 +1,127 @@
1-
package com.vladsch.flexmark.core.test.util.parser;
2-
3-
import com.vladsch.flexmark.parser.MutableListOptions;
4-
import com.vladsch.flexmark.parser.Parser;
5-
import com.vladsch.flexmark.parser.ParserEmulationProfile;
6-
import com.vladsch.flexmark.util.data.MutableDataSet;
7-
import org.junit.Test;
8-
9-
import java.io.ByteArrayOutputStream;
10-
import java.io.InputStream;
11-
12-
import static org.junit.Assert.assertArrayEquals;
13-
import static org.junit.Assert.assertEquals;
14-
import static org.junit.Assert.assertFalse;
15-
import static org.junit.Assert.assertNotNull;
16-
import static org.junit.Assert.assertNotSame;
17-
import static org.junit.Assert.assertSame;
18-
import static org.junit.Assert.assertTrue;
19-
20-
public class ParserEmulationProfileTest {
21-
private static MutableDataSet resolve(ParserEmulationProfile profile) {
22-
MutableDataSet options = new MutableDataSet();
23-
profile.setIn(options);
24-
return options;
25-
}
26-
27-
@Test
28-
public void everyProfileRecordsItsOwnIdentity() {
29-
for (ParserEmulationProfile profile : ParserEmulationProfile.values()) {
30-
assertSame("profile " + profile + " must record itself in PARSER_EMULATION_PROFILE",
31-
profile, Parser.PARSER_EMULATION_PROFILE.get(resolve(profile)));
32-
}
33-
}
34-
35-
@Test
36-
public void everyProfileResolvesItsListOptions() {
37-
for (ParserEmulationProfile profile : ParserEmulationProfile.values()) {
38-
assertEquals("profile " + profile + " must resolve its list options into the data holder",
39-
profile.getOptions().isEndOnDoubleBlank(),
40-
Parser.LISTS_END_ON_DOUBLE_BLANK.get(resolve(profile)));
41-
}
42-
}
43-
44-
/**
45-
* CommonMark 0.26 removed the "two blank lines end a list" rule, so the 0.26 profile must not enable it.
46-
* See the 0.25 to 0.26 specification diff at https://spec.commonmark.org/0.26/changes.html
47-
*/
48-
@Test
49-
public void commonMark_0_26_doesNotEndListsOnDoubleBlank() {
50-
assertFalse(ParserEmulationProfile.COMMONMARK_0_26.getOptions().isEndOnDoubleBlank());
51-
assertFalse(Parser.LISTS_END_ON_DOUBLE_BLANK.get(resolve(ParserEmulationProfile.COMMONMARK_0_26)));
52-
}
53-
54-
/**
55-
* The complete set of list options written by setIn must equal the profile's own list options, not just
56-
* the endOnDoubleBlank flag.
57-
*/
58-
@Test
59-
public void everyProfileResolvesAllOfItsListOptions() {
60-
for (ParserEmulationProfile profile : ParserEmulationProfile.values()) {
61-
assertEquals("profile " + profile + " must resolve all of its list options into the data holder",
62-
profile.getOptions(), new MutableListOptions(resolve(profile)));
63-
}
64-
}
65-
66-
/**
67-
* The defaults of the list options keep the behaviour before CommonMark 0.29, which is enabled only by the
68-
* 0.29 profile through LISTS_NO_ITEM_AT_CODE_INDENT. Except for that option, default list options equal the
69-
* ones of the CommonMark latest profile.
70-
*/
71-
@Test
72-
public void defaultListOptionsEqualTheCommonMarkLatestProfileOptions() {
73-
MutableListOptions latest = ParserEmulationProfile.COMMONMARK_LATEST.getOptions();
74-
assertTrue(latest.isNoItemAtCodeIndent());
75-
assertEquals(latest, new MutableListOptions((com.vladsch.flexmark.util.data.DataHolder) null));
76-
}
77-
78-
@Test
79-
public void versionedCommonMarkProfilesBelongToTheCommonMarkFamily() { for (ParserEmulationProfile profile : new ParserEmulationProfile[]{
80-
ParserEmulationProfile.COMMONMARK_0_26,
81-
ParserEmulationProfile.COMMONMARK_0_27,
82-
ParserEmulationProfile.COMMONMARK_0_28,
83-
ParserEmulationProfile.COMMONMARK_0_29,
84-
ParserEmulationProfile.COMMONMARK_0_30,
85-
ParserEmulationProfile.COMMONMARK_0_31_2,
86-
}) {
87-
assertSame(ParserEmulationProfile.COMMONMARK, profile.family);
88-
}
89-
}
90-
91-
/**
92-
* COMMONMARK_LATEST must alias a concrete implemented version, never the COMMONMARK family sentinel.
93-
*/
94-
@Test
95-
public void commonMarkLatestAliasesAConcreteVersionProfile() {
96-
assertNotSame(ParserEmulationProfile.COMMONMARK, ParserEmulationProfile.COMMONMARK_LATEST);
97-
assertSame(ParserEmulationProfile.COMMONMARK, ParserEmulationProfile.COMMONMARK_LATEST.family);
98-
}
99-
100-
@Test
101-
public void commonMarkLatestIsTheDefaultEmulationProfile() {
102-
assertSame(ParserEmulationProfile.COMMONMARK_LATEST, Parser.PARSER_EMULATION_PROFILE.get(null));
103-
}
104-
105-
/**
106-
* Advancing COMMONMARK_LATEST to a newer specification version is only allowed once that version's full
107-
* specification test passes, and the default spec.txt resource must track it.
108-
*/
109-
@Test
110-
public void commonMarkLatestMatchesTheDefaultSpecificationResource() throws Exception {
111-
assertSame("COMMONMARK_LATEST must be advanced together with spec.txt and VERSION.md",
112-
ParserEmulationProfile.COMMONMARK_0_31_2, ParserEmulationProfile.COMMONMARK_LATEST);
113-
assertArrayEquals("spec.txt must be a copy of the spec file of the version COMMONMARK_LATEST points at",
114-
readSpecResource("/spec.0.31.2.txt"), readSpecResource("/spec.txt"));
115-
}
116-
117-
private static byte[] readSpecResource(String name) throws Exception {
118-
try (InputStream stream = ParserEmulationProfileTest.class.getResourceAsStream(name)) {
119-
assertNotNull("missing specification resource " + name, stream);
120-
ByteArrayOutputStream out = new ByteArrayOutputStream();
121-
byte[] buffer = new byte[8192];
122-
int read;
123-
while ((read = stream.read(buffer)) != -1) out.write(buffer, 0, read);
124-
return out.toByteArray();
125-
}
126-
}
127-
}
1+
package com.vladsch.flexmark.core.test.util.parser;
2+
3+
import com.vladsch.flexmark.parser.MutableListOptions;
4+
import com.vladsch.flexmark.parser.Parser;
5+
import com.vladsch.flexmark.parser.ParserEmulationProfile;
6+
import com.vladsch.flexmark.util.data.MutableDataSet;
7+
import org.junit.Test;
8+
9+
import java.io.ByteArrayOutputStream;
10+
import java.io.InputStream;
11+
12+
import static org.junit.Assert.assertArrayEquals;
13+
import static org.junit.Assert.assertEquals;
14+
import static org.junit.Assert.assertFalse;
15+
import static org.junit.Assert.assertNotNull;
16+
import static org.junit.Assert.assertNotSame;
17+
import static org.junit.Assert.assertSame;
18+
import static org.junit.Assert.assertTrue;
19+
20+
public class ParserEmulationProfileTest {
21+
private static MutableDataSet resolve(ParserEmulationProfile profile) {
22+
MutableDataSet options = new MutableDataSet();
23+
profile.setIn(options);
24+
return options;
25+
}
26+
27+
@Test
28+
public void everyProfileRecordsItsOwnIdentity() {
29+
for (ParserEmulationProfile profile : ParserEmulationProfile.values()) {
30+
assertSame("profile " + profile + " must record itself in PARSER_EMULATION_PROFILE",
31+
profile, Parser.PARSER_EMULATION_PROFILE.get(resolve(profile)));
32+
}
33+
}
34+
35+
@Test
36+
public void everyProfileResolvesItsListOptions() {
37+
for (ParserEmulationProfile profile : ParserEmulationProfile.values()) {
38+
assertEquals("profile " + profile + " must resolve its list options into the data holder",
39+
profile.getOptions().isEndOnDoubleBlank(),
40+
Parser.LISTS_END_ON_DOUBLE_BLANK.get(resolve(profile)));
41+
}
42+
}
43+
44+
/**
45+
* CommonMark 0.26 removed the "two blank lines end a list" rule, so the 0.26 profile must not enable it.
46+
* See the 0.25 to 0.26 specification diff at https://spec.commonmark.org/0.26/changes.html
47+
*/
48+
@Test
49+
public void commonMark_0_26_doesNotEndListsOnDoubleBlank() {
50+
assertFalse(ParserEmulationProfile.COMMONMARK_0_26.getOptions().isEndOnDoubleBlank());
51+
assertFalse(Parser.LISTS_END_ON_DOUBLE_BLANK.get(resolve(ParserEmulationProfile.COMMONMARK_0_26)));
52+
}
53+
54+
/**
55+
* The complete set of list options written by setIn must equal the profile's own list options, not just
56+
* the endOnDoubleBlank flag.
57+
*/
58+
@Test
59+
public void everyProfileResolvesAllOfItsListOptions() {
60+
for (ParserEmulationProfile profile : ParserEmulationProfile.values()) {
61+
assertEquals("profile " + profile + " must resolve all of its list options into the data holder",
62+
profile.getOptions(), new MutableListOptions(resolve(profile)));
63+
}
64+
}
65+
66+
/**
67+
* The defaults of the list options keep the behaviour before CommonMark 0.29, which is enabled only by the
68+
* 0.29 profile through LISTS_NO_ITEM_AT_CODE_INDENT. Except for that option, default list options equal the
69+
* ones of the CommonMark latest profile.
70+
*/
71+
@Test
72+
public void defaultListOptionsEqualTheCommonMarkLatestProfileOptions() {
73+
MutableListOptions latest = ParserEmulationProfile.COMMONMARK_LATEST.getOptions();
74+
assertTrue(latest.isNoItemAtCodeIndent());
75+
assertEquals(latest, new MutableListOptions((com.vladsch.flexmark.util.data.DataHolder) null));
76+
}
77+
78+
@Test
79+
public void versionedCommonMarkProfilesBelongToTheCommonMarkFamily() { for (ParserEmulationProfile profile : new ParserEmulationProfile[]{
80+
ParserEmulationProfile.COMMONMARK_0_26,
81+
ParserEmulationProfile.COMMONMARK_0_27,
82+
ParserEmulationProfile.COMMONMARK_0_28,
83+
ParserEmulationProfile.COMMONMARK_0_29,
84+
ParserEmulationProfile.COMMONMARK_0_30,
85+
ParserEmulationProfile.COMMONMARK_0_31_2,
86+
}) {
87+
assertSame(ParserEmulationProfile.COMMONMARK, profile.family);
88+
}
89+
}
90+
91+
/**
92+
* COMMONMARK_LATEST must alias a concrete implemented version, never the COMMONMARK family sentinel.
93+
*/
94+
@Test
95+
public void commonMarkLatestAliasesAConcreteVersionProfile() {
96+
assertNotSame(ParserEmulationProfile.COMMONMARK, ParserEmulationProfile.COMMONMARK_LATEST);
97+
assertSame(ParserEmulationProfile.COMMONMARK, ParserEmulationProfile.COMMONMARK_LATEST.family);
98+
}
99+
100+
@Test
101+
public void commonMarkLatestIsTheDefaultEmulationProfile() {
102+
assertSame(ParserEmulationProfile.COMMONMARK_LATEST, Parser.PARSER_EMULATION_PROFILE.get(null));
103+
}
104+
105+
/**
106+
* Advancing COMMONMARK_LATEST to a newer specification version is only allowed once that version's full
107+
* specification test passes, and the default spec.txt resource must track it.
108+
*/
109+
@Test
110+
public void commonMarkLatestMatchesTheDefaultSpecificationResource() throws Exception {
111+
assertSame("COMMONMARK_LATEST must be advanced together with spec.txt and VERSION.md",
112+
ParserEmulationProfile.COMMONMARK_0_31_2, ParserEmulationProfile.COMMONMARK_LATEST);
113+
assertArrayEquals("spec.txt must be a copy of the spec file of the version COMMONMARK_LATEST points at",
114+
readSpecResource("/spec.0.31.2.txt"), readSpecResource("/spec.txt"));
115+
}
116+
117+
private static byte[] readSpecResource(String name) throws Exception {
118+
try (InputStream stream = ParserEmulationProfileTest.class.getResourceAsStream(name)) {
119+
assertNotNull("missing specification resource " + name, stream);
120+
ByteArrayOutputStream out = new ByteArrayOutputStream();
121+
byte[] buffer = new byte[8192];
122+
int read;
123+
while ((read = stream.read(buffer)) != -1) out.write(buffer, 0, read);
124+
return out.toByteArray();
125+
}
126+
}
127+
}

0 commit comments

Comments
 (0)