diff --git a/importer/markdown/src/test/java/org/itsallcode/openfasttrace/importer/markdown/TestMarkdownImporter.java b/importer/markdown/src/test/java/org/itsallcode/openfasttrace/importer/markdown/TestMarkdownImporter.java index 8f847892..e47a4e7f 100644 --- a/importer/markdown/src/test/java/org/itsallcode/openfasttrace/importer/markdown/TestMarkdownImporter.java +++ b/importer/markdown/src/test/java/org/itsallcode/openfasttrace/importer/markdown/TestMarkdownImporter.java @@ -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); diff --git a/importer/markdown/src/test/java/org/itsallcode/openfasttrace/importer/markdown/TestMarkdownMarkupImporter.java b/importer/markdown/src/test/java/org/itsallcode/openfasttrace/importer/markdown/TestMarkdownMarkupImporter.java index 2f6595cc..671435e6 100644 --- a/importer/markdown/src/test/java/org/itsallcode/openfasttrace/importer/markdown/TestMarkdownMarkupImporter.java +++ b/importer/markdown/src/test/java/org/itsallcode/openfasttrace/importer/markdown/TestMarkdownMarkupImporter.java @@ -12,7 +12,7 @@ class TestMarkdownMarkupImporter extends AbstractLightWeightMarkupImporterTest { - private final static ImporterFactory importerFactory = new MarkdownImporterFactory(); + private static final ImporterFactory importerFactory = new MarkdownImporterFactory(); TestMarkdownMarkupImporter() { diff --git a/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/importer/lightweightmarkup/AbstractLightWeightMarkupImporterTest.java b/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/importer/lightweightmarkup/AbstractLightWeightMarkupImporterTest.java index b4083f96..53765a5a 100644 --- a/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/importer/lightweightmarkup/AbstractLightWeightMarkupImporterTest.java +++ b/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/importer/lightweightmarkup/AbstractLightWeightMarkupImporterTest.java @@ -163,6 +163,7 @@ static Stream 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")), @@ -171,7 +172,17 @@ static Stream 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