Skip to content

Commit

Permalink
Test case failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihxil committed Oct 6, 2024
1 parent 17080e5 commit 5509309
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/main/java/org/meeuw/i18n/languages/ISO_639_3_Code.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ private ISO_639_3_Code(
* @return A 2 or 3 letter language code
* @since 0.2
*/
@Override
@JsonValue
public String code() {
return part1 != null ? part1 : part3;
Expand All @@ -233,6 +234,7 @@ public String toString() {



@Override
public String part3() {
return part3;
}
Expand All @@ -242,6 +244,7 @@ public String part3() {
* code set, if there is one
* @return bibliographic id or {@code null}
*/
@Override
public String part2B() {
return part2B;
}
Expand All @@ -251,6 +254,7 @@ public String part2B() {
* set, if there is one
* @return terminology id or {@code null}
*/
@Override
public String part2T() {
return part2T;
}
Expand All @@ -259,22 +263,27 @@ public String part2T() {
* Equivalent 639-1 identifier, if there is one
* @return 2 letter id or {@code null}
*/
@Override
public String part1() {
return part1;
}

@Override
public Scope scope() {
return scope;
}

@Override
public Type languageType() {
return languageType;
}

@Override
public String refName() {
return refName;
}

@Override
public String comment() {
return comment;
}
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/meeuw/i18n/languages/LanguageCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,13 @@ default String getCode() {
*/
String part1();

@Override
Scope scope();

@Override
Type languageType();

@Override
String refName();

String comment();
Expand All @@ -366,7 +369,8 @@ default Locale toLocale() {
return new Locale(code());
}

default NameRecord name(Locale locale) {
@Override
default NameRecord nameRecord(Locale locale) {
if (locale.getLanguage().equals("en")) {
return nameRecords().get(0);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.*;
import java.util.concurrent.atomic.AtomicLong;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.meeuw.i18n.languages.*;

Expand Down Expand Up @@ -208,4 +209,12 @@ public void deprecated() {
assertThat(LanguageCode.getByPart2T("nld")).contains((LanguageCode) ISO_639.get("nl").get());
assertThat(LanguageCode.getByPart3("nld")).contains((LanguageCode) ISO_639.get("nl").get());
}


// TODO
@Disabled
@Test
public void hashCodeStable() {
assertThat(ISO_639.iso639("NL").hashCode()).isEqualTo(320304382);
}
}

0 comments on commit 5509309

Please sign in to comment.