@@ -173,56 +173,22 @@ var _ = Describe("Process Metrics", func() {
173
173
174
174
var _ = Describe ("ProcessNewlineChars" , func () {
175
175
type testCase struct {
176
- input string
177
- deduplicate bool
178
- trim bool
179
- expected string
176
+ input string
177
+ expected string
180
178
}
181
179
182
180
DescribeTable ("should" ,
183
181
func (given testCase ) {
184
- actual := string (processNewlineChars ([]byte (given .input ), given . deduplicate , given . trim ))
182
+ actual := string (processNewlineChars ([]byte (given .input )))
185
183
Expect (actual ).To (Equal (given .expected ))
186
184
},
187
- Entry ("should not deduplicate or trim newline characters" , testCase {
188
- input : "This is a test.\n \n This is another test.\n " ,
189
- deduplicate : false ,
190
- trim : false ,
191
- expected : "This is a test.\n \n This is another test.\n " ,
192
- }),
193
- Entry ("should deduplicate newline characters" , testCase {
194
- input : "This is a test.\n \n \n This is another test.\n " ,
195
- deduplicate : true ,
196
- trim : false ,
197
- expected : "This is a test.\n This is another test.\n " ,
185
+ Entry ("should dedup newline characters and trim spaces" , testCase {
186
+ input : "\n This is a test.\n \n \n \n This is another test\n \n " ,
187
+ expected : "This is a test.\n This is another test" ,
198
188
}),
199
- Entry ("should trim leading and trailing newline characters" , testCase {
200
- input : "\n This is a test.\n \n This is another test\n \n " ,
201
- deduplicate : false ,
202
- trim : true ,
203
- expected : "This is a test.\n \n This is another test" ,
204
- }),
205
- Entry ("should deduplicate and trim newline characters" , testCase {
206
- input : "\n This is a test.\n \n \n This is another test\n " ,
207
- deduplicate : true ,
208
- trim : true ,
209
- expected : "This is a test.\n This is another test" ,
210
- }),
211
- )
212
- })
213
-
214
- var _ = Describe ("Dedup" , func () {
215
- type testCase struct {
216
- input string
217
- expected string
218
- }
219
- DescribeTable ("should" , func (given testCase ) {
220
- actual := string (dedupFn ([]byte (given .input ), '\n' , '\n' ))
221
- Expect (actual ).To (Equal (given .expected ))
222
- },
223
- Entry ("should deduplicate newline characters" , testCase {
224
- input : "This is a test.\n \n \n \n This is another test.\n " ,
225
- expected : "This is a test.\n This is another test.\n " ,
189
+ Entry ("should dedup newline characters and trim spaces" , testCase {
190
+ input : "\n This is a test.\n \n This is another test\n " ,
191
+ expected : "This is a test.\n \n This is another test" ,
226
192
}),
227
193
)
228
194
})
0 commit comments