Skip to content

Commit

Permalink
#419: Add tests for inconsistent tag parsing, see #423
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada committed Jul 6, 2024
1 parent d945fc6 commit 509cae4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ void testIdentifyTags(final String text)

@ParameterizedTest
@CsvSource(
{ "Tags:", "#Needs: abc", "' Needs: abc'", "Needs: änderung" })
{ "Tags:", "#Needs: abc", "' Needs: abc'", "Needs: änderung", "Tags: -leadingDash", "Tags: trailingDash-",
"Tags: tag with spaces", "Tags: Täg" })
void testIdentifyNonTags(final String text)
{
MarkdownAsserts.assertMismatch(MdPattern.TAGS_INT, text);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class TestMarkdownMarkupImporter extends AbstractLightWeightMarkupImporterTest
{
private final static ImporterFactory importerFactory = new MarkdownImporterFactory();
private static final ImporterFactory importerFactory = new MarkdownImporterFactory();

TestMarkdownMarkupImporter()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ static Stream<Arguments> tags()
return Stream.of(
Arguments.of("Tags: req , dsn ", List.of("req", "dsn")),
Arguments.of("Tags: req ", List.of("req")),
Arguments.of("Tags: req_1 ", List.of("req_1")),
Arguments.of("Tags: req,dsn ", List.of("req", "dsn")),
Arguments.of("Tags: req ,dsn", List.of("req", "dsn")),
Arguments.of("Tags: req,dsn", List.of("req", "dsn")),
Expand All @@ -171,7 +172,17 @@ static Stream<Arguments> tags()
Arguments.of("Tags:\n* req\n* dsn", List.of("req", "dsn")),
Arguments.of("Tags:\n * req\n * dsn\n", List.of("req", "dsn")),
Arguments.of("Tags:\n* req \n\t* dsn ", List.of("req", "dsn")),
Arguments.of("Tags:\n* req\n* dsn", List.of("req", "dsn")));
Arguments.of("Tags:\n* req\n* dsn", List.of("req", "dsn")),
Arguments.of("Tags:\n* req_1\n* dsn_2", List.of("req_1", "dsn_2")),

// Inconsistent behavior, see
// https://github.com/itsallcode/openfasttrace/issues/423
Arguments.of("Tags: _ ", List.of("_")),
Arguments.of("Tags: täg1, taeg2", List.of()),
Arguments.of("Tags: _tag1, taeg2", List.of("_tag1", "taeg2")),
Arguments.of("Tags: -dash, tag", List.of()),
Arguments.of("Tags:\n* tag1\n* täg2", List.of("tag1", "täg2")),
Arguments.of("Tags:\n* -tag1\n* täg2", List.of("-tag1", "täg2")));
}

@ParameterizedTest
Expand Down

0 comments on commit 509cae4

Please sign in to comment.