diff --git a/internal/reader/processor/processor_test.go b/internal/reader/processor/processor_test.go deleted file mode 100644 index 99a182c2..00000000 --- a/internal/reader/processor/processor_test.go +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 - -package processor // import "miniflux.app/v2/internal/reader/processor" - -import ( - "testing" -) - -func TestMinifyEntryContent(t *testing.T) { - input := `
Some text with a link
` - expected := `Some text with a link
` - result := minifyContent(input) - if expected != result { - t.Errorf(`Unexpected result, got %q`, result) - } -} diff --git a/internal/reader/processor/utils_test.go b/internal/reader/processor/utils_test.go new file mode 100644 index 00000000..5eac6254 --- /dev/null +++ b/internal/reader/processor/utils_test.go @@ -0,0 +1,44 @@ +// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +package processor // import "miniflux.app/v2/internal/reader/processor" + +import ( + "testing" +) + +func TestMinifyEntryContentWithWhitespace(t *testing.T) { + input := `Some text with a link
` + expected := `Some text with a link
` + result := minifyContent(input) + if expected != result { + t.Errorf(`Unexpected result, got %q`, result) + } +} + +func TestMinifyContentWithDefaultAttributes(t *testing.T) { + input := `` + expected := `` + result := minifyContent(input) + if expected != result { + t.Errorf(`Unexpected result, got %q`, result) + } +} + +func TestMinifyContentWithComments(t *testing.T) { + input := `Some text with a link.
` + expected := `Some text with a link.
` + result := minifyContent(input) + if expected != result { + t.Errorf(`Unexpected result, got %q`, result) + } +} + +func TestMinifyContentWithSpecialComments(t *testing.T) { + input := `Some text with a link.
` + expected := `Some text with a link.
` + result := minifyContent(input) + if expected != result { + t.Errorf(`Unexpected result, got %q`, result) + } +}