File tree 2 files changed +79
-0
lines changed
2 files changed +79
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,60 @@ And this?
88
88
" H2 {h22}"
89
89
]
90
90
91
+ [<Fact>]
92
+ let testSymsWhenRepeatedHeadingsGlfm () =
93
+ let doc =
94
+ """
95
+ # X^
96
+ # A
97
+ # A
98
+ # X
99
+ # Z
100
+ ## A
101
+ """
102
+
103
+ let strukt =
104
+ Parser.parse { ParserSettings.Default with titleFromHeading = false } ( Text.mkText doc)
105
+
106
+ Helpers.checkInlineSnapshot _. ToString() strukt.Symbols [
107
+ " Doc"
108
+ " H1 {a}"
109
+ " H1 {a-1}"
110
+ " H1 {x}"
111
+ " H1 {x-1}"
112
+ " H1 {z}"
113
+ " H2 {a-2}"
114
+ ]
115
+
116
+ [<Fact>]
117
+ let testSymsWhenRepeatedHeadingsNoGlfm () =
118
+ let doc =
119
+ """
120
+ # X^
121
+ # A
122
+ # A
123
+ # X
124
+ # Z
125
+ ## A
126
+ """
127
+
128
+ let strukt =
129
+ Parser.parse
130
+ {
131
+ ParserSettings.Default with
132
+ titleFromHeading = false
133
+ glfmHeadingIds = false
134
+ }
135
+ ( Text.mkText doc)
136
+
137
+ Helpers.checkInlineSnapshot _. ToString() strukt.Symbols [
138
+ " Doc"
139
+ " H1 {a}"
140
+ " H1 {x}"
141
+ " H1 {z}"
142
+ " H2 {a}"
143
+ ]
144
+
91
145
[<Fact>]
92
146
let testSymsWhenTitleFromHeadingIsOn () =
93
147
let doc =
Original file line number Diff line number Diff line change @@ -115,6 +115,20 @@ candidates = 100
115
115
116
116
Assert.Equal( Some expected, actual)
117
117
118
+ [<Fact>]
119
+ let testParse_8 () =
120
+ let content =
121
+ """
122
+ [core]
123
+ markdown.glfm_heading_ids.enable = true
124
+ """
125
+
126
+ let actual = Config.tryParse content
127
+
128
+ let expected = { Config.Empty with coreMarkdownGlfmHeadingIdsEnable = Some true }
129
+
130
+ Assert.Equal( Some expected, actual)
131
+
118
132
[<Fact>]
119
133
let testParse_broken_0 () =
120
134
let content =
@@ -180,6 +194,17 @@ candidates = -1
180
194
let actual = Config.tryParse content
181
195
Assert.Equal( None, actual)
182
196
197
+ [<Fact>]
198
+ let testParse_broken_6 () =
199
+ let content =
200
+ """
201
+ [core]
202
+ markdown.glfm_heading_ids.enable = -1
203
+ """
204
+
205
+ let actual = Config.tryParse content
206
+ Assert.Equal( None, actual)
207
+
183
208
[<Fact>]
184
209
let testDefault () =
185
210
let content =
You can’t perform that action at this time.
0 commit comments