Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump org.junit.jupiter:junit-jupiter from 5.9.3 to 5.10.0 #269

Merged
merged 2 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom_parent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<argLine>-Dfile.encoding=UTF-8</argLine>

<!-- test resources -->
<junit.version>5.9.3</junit.version>
<junit.version>5.10.0</junit.version>
<wiremock.version>2.35.0</wiremock.version>

<sonar.projectKey>filip26_titanium-json-ld</sonar.projectKey>
Expand Down
121 changes: 58 additions & 63 deletions src/test/java/com/apicatalog/jsonld/lang/LanguageTagTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void testWellFormed(final String tag, final boolean expected) {

@ParameterizedTest(name = "isWellFormed({0}): {1}")
@MethodSource("validTags")
void testToString(final String tag, final boolean expected) {
void testToString(final String tag) {

final LanguageTag languageTag = LanguageTag.create(tag);

Expand All @@ -57,11 +57,10 @@ void testToString(final String tag, final boolean expected) {
@ParameterizedTest(name = "parse({0}): {1}")
@MethodSource("validTags")
void testParse(final String tag,
final String language,
final Collection<String> langExt,
final String script,
final String region
) {
final String language,
final Collection<String> langExt,
final String script,
final String region) {

final LanguageTag languageTag = LanguageTag.create(tag);

Expand All @@ -72,68 +71,64 @@ void testParse(final String tag,
assertEquals(region, languageTag.getRegion());
}


static final Stream<Arguments> data() {
return Stream.of(
arguments("", false),
arguments(" ", false),
arguments("cs--CZ", false),
arguments("cs-a-CZ", true),
arguments("cs-", false),
arguments("-cs", false),
arguments("c#-CZ", false),
arguments("A1B2", false),
arguments("1", false),
arguments("abcd1234-abcd1234", false),
arguments("a-b-", false),

arguments("cs", true),
arguments("cs-CZ", true),
arguments("en-US", true),
arguments("en-US", true),

arguments("A", false),
arguments("A-0", false),
arguments("abcd-1234", true),
arguments("abcd-1234567890", false),

// extension subtags
arguments("en-x-US", true),
arguments("el-x-koine", true),
arguments("el-x-attic", true),
arguments("en-x-lgr", true),
arguments("de-CH-x-phonebk", true),
arguments("az-Arab-x-AZE-derbend", true),
arguments("zh-variant1-variant2", true),
arguments("zh-variant1-1abc", true),
arguments("zh-Latn-CN-variant1-a-extend1-b-extend2", true),
arguments("zh-Latn-CN-variant1-a-extend1-x-wadegile", true),
arguments("en-Latn-GB-boont-r-extended-sequence-x-private", true),
arguments("en-Latn-GB-boont-r-extended-sequence-x-private-b-private2", true),
arguments("en-Latn-GB-boont-r-extended-sequence-x-private-private2", true),

arguments("de-419-DE", false),
arguments("a-DE", false),

// private use
arguments("x-private", true),

// grandfathered regular
arguments("zh-min-nan", true)
);
arguments("", false),
arguments(" ", false),
arguments("cs--CZ", false),
arguments("cs-a-CZ", true),
arguments("cs-", false),
arguments("-cs", false),
arguments("c#-CZ", false),
arguments("A1B2", false),
arguments("1", false),
arguments("abcd1234-abcd1234", false),
arguments("a-b-", false),

arguments("cs", true),
arguments("cs-CZ", true),
arguments("en-US", true),
arguments("en-US", true),

arguments("A", false),
arguments("A-0", false),
arguments("abcd-1234", true),
arguments("abcd-1234567890", false),

// extension subtags
arguments("en-x-US", true),
arguments("el-x-koine", true),
arguments("el-x-attic", true),
arguments("en-x-lgr", true),
arguments("de-CH-x-phonebk", true),
arguments("az-Arab-x-AZE-derbend", true),
arguments("zh-variant1-variant2", true),
arguments("zh-variant1-1abc", true),
arguments("zh-Latn-CN-variant1-a-extend1-b-extend2", true),
arguments("zh-Latn-CN-variant1-a-extend1-x-wadegile", true),
arguments("en-Latn-GB-boont-r-extended-sequence-x-private", true),
arguments("en-Latn-GB-boont-r-extended-sequence-x-private-b-private2", true),
arguments("en-Latn-GB-boont-r-extended-sequence-x-private-private2", true),

arguments("de-419-DE", false),
arguments("a-DE", false),

// private use
arguments("x-private", true),

// grandfathered regular
arguments("zh-min-nan", true));
}

static final Stream<Arguments> validTags() {
return Stream.of(
arguments("cs", "cs", null, null, null),
arguments("cs-CZ", "cs", null, null, "CZ"),
arguments("en-US", "en", null, null, "US"),

arguments("en-Latn-GB-boont-r-extended-sequence-x-private-b-private2",
"en", null, "Latn", "GB", Arrays.asList("boont"),
Arrays.asList(new Extension('r', Arrays.asList("extended", "sequence"))),
Arrays.asList("private", "b", "private2")
)
);
arguments("cs", "cs", null, null, null),
arguments("cs-CZ", "cs", null, null, "CZ"),
arguments("en-US", "en", null, null, "US"),

arguments("en-Latn-GB-boont-r-extended-sequence-x-private-b-private2",
"en", null, "Latn", "GB", Arrays.asList("boont"),
Arrays.asList(new Extension('r', Arrays.asList("extended", "sequence"))),
Arrays.asList("private", "b", "private2")));
}
}
Loading