Skip to content

Commit

Permalink
Fix local in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nroduit committed Jul 26, 2024
1 parent e2a7f4f commit 1959622
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
import org.junit.jupiter.api.Test;
import org.junitpioneer.jupiter.DefaultLocale;
import org.mockito.Mockito;

class FileUtilTest {
Expand Down Expand Up @@ -423,10 +424,8 @@ void testZip() throws IOException {

/** Method under test: {@link FileUtil#humanReadableByte(long, boolean)} */
@Test
@DefaultLocale(language = "en", country = "US")
void testHumanReadableByte() {
Locale old = Locale.getDefault();
Locale.setDefault(Locale.US);

assertEquals("1 B", FileUtil.humanReadableByte(1L, true));
assertEquals("1 B", FileUtil.humanReadableByte(1L, false));
assertEquals("1.0 kB", FileUtil.humanReadableByte(1000L, true));
Expand All @@ -435,8 +434,6 @@ void testHumanReadableByte() {
assertEquals("1.2 GiB", FileUtil.humanReadableByte(1256799945L, false));
assertEquals("-9.2 EB", FileUtil.humanReadableByte(Long.MIN_VALUE, true));
assertEquals("-8.0 EiB", FileUtil.humanReadableByte(Long.MIN_VALUE, false));

Locale.setDefault(old);
}

/**
Expand Down

0 comments on commit 1959622

Please sign in to comment.