@@ -6,8 +6,7 @@ import XCTest
66class DefaultRawSuggestionPostProcessingStrategyTests : XCTestCase {
77 func test_whenSuggestionHasCodeTagAtTheFirstLine_shouldExtractCodeInside( ) {
88 let strategy = DefaultRawSuggestionPostProcessingStrategy (
9- openingCodeTag: " <Code> " ,
10- closingCodeTag: " </Code> "
9+ codeWrappingTags: ( " <Code> " , " </Code> " )
1110 )
1211 let result = strategy. extractSuggestion (
1312 from: """
@@ -21,8 +20,7 @@ class DefaultRawSuggestionPostProcessingStrategyTests: XCTestCase {
2120 func test_whenSuggestionHasCodeTagAtTheFirstLine_closingTagInOtherLines_shouldExtractCodeInside(
2221 ) {
2322 let strategy = DefaultRawSuggestionPostProcessingStrategy (
24- openingCodeTag: " <Code> " ,
25- closingCodeTag: " </Code> "
23+ codeWrappingTags: ( " <Code> " , " </Code> " )
2624 )
2725 let result = strategy. extractSuggestion (
2826 from: """
@@ -36,8 +34,7 @@ class DefaultRawSuggestionPostProcessingStrategyTests: XCTestCase {
3634
3735 func test_whenSuggestionHasCodeTag_butNoClosingTag_shouldExtractCodeAfterTheTag( ) {
3836 let strategy = DefaultRawSuggestionPostProcessingStrategy (
39- openingCodeTag: " <Code> " ,
40- closingCodeTag: " </Code> "
37+ codeWrappingTags: ( " <Code> " , " </Code> " )
4138 )
4239 let result = strategy. extractSuggestion (
4340 from: """
@@ -51,8 +48,7 @@ class DefaultRawSuggestionPostProcessingStrategyTests: XCTestCase {
5148
5249 func test_whenMultipleOpeningTagFound_shouldTreatTheNextOneAsClosing( ) {
5350 let strategy = DefaultRawSuggestionPostProcessingStrategy (
54- openingCodeTag: " <Code> " ,
55- closingCodeTag: " </Code> "
51+ codeWrappingTags: ( " <Code> " , " </Code> " )
5652 )
5753 let result = strategy. extractSuggestion (
5854 from: """
@@ -64,8 +60,7 @@ class DefaultRawSuggestionPostProcessingStrategyTests: XCTestCase {
6460
6561 func test_whenMarkdownCodeBlockFound_shouldExtractCodeInside( ) {
6662 let strategy = DefaultRawSuggestionPostProcessingStrategy (
67- openingCodeTag: " <Code> " ,
68- closingCodeTag: " </Code> "
63+ codeWrappingTags: ( " <Code> " , " </Code> " )
6964 )
7065 let result = strategy. extractSuggestion (
7166 from: """
@@ -80,8 +75,7 @@ class DefaultRawSuggestionPostProcessingStrategyTests: XCTestCase {
8075
8176 func test_whenOnlyLinebreaksOrSpacesBeforeMarkdownCodeBlock_shouldExtractCodeInside( ) {
8277 let strategy = DefaultRawSuggestionPostProcessingStrategy (
83- openingCodeTag: " <Code> " ,
84- closingCodeTag: " </Code> "
78+ codeWrappingTags: ( " <Code> " , " </Code> " )
8579 )
8680 let result = strategy. extractSuggestion (
8781 from: """
@@ -120,8 +114,7 @@ class DefaultRawSuggestionPostProcessingStrategyTests: XCTestCase {
120114
121115 func test_whenMarkdownCodeBlockAndCodeTagFound_firstlyExtractCodeTag_thenCodeTag( ) {
122116 let strategy = DefaultRawSuggestionPostProcessingStrategy (
123- openingCodeTag: " <Code> " ,
124- closingCodeTag: " </Code> "
117+ codeWrappingTags: ( " <Code> " , " </Code> " )
125118 )
126119 let result = strategy. extractSuggestion (
127120 from: """
@@ -137,8 +130,7 @@ class DefaultRawSuggestionPostProcessingStrategyTests: XCTestCase {
137130 func test_whenMarkdownCodeBlockAndCodeTagFound_butNoClosingTag_firstlyExtractCodeTag_thenCodeTag(
138131 ) {
139132 let strategy = DefaultRawSuggestionPostProcessingStrategy (
140- openingCodeTag: " <Code> " ,
141- closingCodeTag: " </Code> "
133+ codeWrappingTags: ( " <Code> " , " </Code> " )
142134 )
143135 let result = strategy. extractSuggestion (
144136 from: """
@@ -153,8 +145,7 @@ class DefaultRawSuggestionPostProcessingStrategyTests: XCTestCase {
153145
154146 func test_whenSuggestionHasTheSamePrefix_removeThePrefix( ) {
155147 let strategy = DefaultRawSuggestionPostProcessingStrategy (
156- openingCodeTag: " <Code> " ,
157- closingCodeTag: " </Code> "
148+ codeWrappingTags: ( " <Code> " , " </Code> " )
158149 )
159150 let result = strategy. extractSuggestion (
160151 from: " suggestion "
@@ -165,8 +156,7 @@ class DefaultRawSuggestionPostProcessingStrategyTests: XCTestCase {
165156
166157 func test_whenSuggestionLooksLikeAMessage_parseItCorrectly( ) {
167158 let strategy = DefaultRawSuggestionPostProcessingStrategy (
168- openingCodeTag: " <Code> " ,
169- closingCodeTag: " </Code> "
159+ codeWrappingTags: ( " <Code> " , " </Code> " )
170160 )
171161 let result = strategy. extractSuggestion (
172162 from: """
@@ -182,8 +172,7 @@ class DefaultRawSuggestionPostProcessingStrategyTests: XCTestCase {
182172
183173 func test_whenSuggestionHasTheSamePrefix_inTags_removeThePrefix( ) {
184174 let strategy = DefaultRawSuggestionPostProcessingStrategy (
185- openingCodeTag: " <Code> " ,
186- closingCodeTag: " </Code> "
175+ codeWrappingTags: ( " <Code> " , " </Code> " )
187176 )
188177 var suggestion = " prefix suggestion "
189178 strategy. removePrefix ( from: & suggestion, infillPrefix: " prefix " )
@@ -193,8 +182,7 @@ class DefaultRawSuggestionPostProcessingStrategyTests: XCTestCase {
193182
194183 func test_whenSuggestionHasTheSameSuffix_removeTheSuffix( ) {
195184 let strategy = DefaultRawSuggestionPostProcessingStrategy (
196- openingCodeTag: " <Code> " ,
197- closingCodeTag: " </Code> "
185+ codeWrappingTags: ( " <Code> " , " </Code> " )
198186 )
199187 var suggestion = " suggestion \n a \n b "
200188 strategy. removeSuffix ( from: & suggestion, suffix: [
@@ -214,11 +202,10 @@ class DefaultRawSuggestionPostProcessingStrategyTests: XCTestCase {
214202
215203 XCTAssertEqual ( suggestion3, " suggestion \n a \n " )
216204 }
217-
205+
218206 func test_case_1( ) {
219207 let strategy = DefaultRawSuggestionPostProcessingStrategy (
220- openingCodeTag: " <Code> " ,
221- closingCodeTag: " </Code> "
208+ codeWrappingTags: ( " <Code> " , " </Code> " )
222209 )
223210 let result = strategy. postProcess (
224211 rawSuggestion: """
0 commit comments