Skip to content

Commit

Permalink
#up: #153 assumption
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Apr 4, 2023
1 parent 291e4bf commit 0cc97a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/test/java/com/jcabi/log/Printed.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@
package com.jcabi.log;

import java.io.ByteArrayOutputStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.Formattable;
import java.util.Formatter;
import java.util.Locale;

/**
* Prints decor.
Expand Down
5 changes: 5 additions & 0 deletions src/test/java/com/jcabi/log/TextDecorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/
package com.jcabi.log;

import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.Collection;
import java.util.Formattable;
Expand All @@ -37,6 +38,8 @@
import org.apache.commons.lang3.StringUtils;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
Expand All @@ -53,6 +56,7 @@ public final class TextDecorTest {
@MethodSource("params")
public void testPrintsRight(final String obj, final String text,
final int flags, final int width, final int precision) {
Assumptions.assumeTrue("UTF-8".equals(Charset.defaultCharset().name()));
Locale.setDefault(Locale.US);
MatcherAssert.assertThat(
new Printed(new TextDecor(obj), flags, width, precision),
Expand All @@ -64,6 +68,7 @@ public void testPrintsRight(final String obj, final String text,
@MethodSource("params")
public void testLogsRight(final String obj, final String text,
final int flags, final int width, final int precision) {
Assumptions.assumeTrue("UTF-8".equals(Charset.defaultCharset().name()));
Locale.setDefault(Locale.US);
MatcherAssert.assertThat(
new Logged(new TextDecor(obj), flags, width, precision),
Expand Down

0 comments on commit 0cc97a8

Please sign in to comment.