Skip to content

Commit

Permalink
test: support NBSP and empty space for testing
Browse files Browse the repository at this point in the history
.replace("\u00a0"," ");
  • Loading branch information
jy95 committed Feb 9, 2025
1 parent 3f9a52f commit 5f134e6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void testNoDuration(Locale locale) throws ExecutionException, InterruptedExcepti
void testWithDurationOnly(Locale locale) throws ExecutionException, InterruptedException {
var dosage = generateWithDurationOnly();
var dosageUtils = getDosageAPI(locale, DisplayOrder.DURATION_DURATION_MAX);
String result = dosageUtils.asHumanReadableText(dosage).get();
String result = dosageUtils.asHumanReadableText(dosage).get().replace("\u00a0"," ");;
String expectedResult = getExpectedText1(locale);
assertEquals(expectedResult, result);
}
Expand All @@ -51,7 +51,7 @@ private String getExpectedText1(Locale locale) {
void testWithDurationMaxOnly(Locale locale) throws ExecutionException, InterruptedException {
var dosage = generateWithDurationMaxOnly();
var dosageUtils = getDosageAPI(locale, DisplayOrder.DURATION_DURATION_MAX);
String result = dosageUtils.asHumanReadableText(dosage).get();
String result = dosageUtils.asHumanReadableText(dosage).get().replace("\u00a0"," ");;
String expectedResult = getExpectedText2(locale);
assertEquals(expectedResult, result);
}
Expand All @@ -75,7 +75,7 @@ private String getExpectedText2(Locale locale) {
void testWithBothDuration(Locale locale) throws ExecutionException, InterruptedException {
var dosage = generateWithBothDuration();
var dosageUtils = getDosageAPI(locale, DisplayOrder.DURATION_DURATION_MAX);
String result = dosageUtils.asHumanReadableText(dosage).get();
String result = dosageUtils.asHumanReadableText(dosage).get().replace("\u00a0"," ");;
String expectedResult = getExpectedText3(locale);
assertEquals(expectedResult, result);
}
Expand Down

0 comments on commit 5f134e6

Please sign in to comment.