Skip to content
Permalink
Browse files
Fix broken tests.
  • Loading branch information
garydgregory committed May 5, 2022
1 parent 89fd430 commit dce89548558b615938f2c1635c1c8d2edb88020d
Showing 1 changed file with 8 additions and 8 deletions.
@@ -18,16 +18,17 @@

package org.apache.commons.compress;

import org.apache.commons.compress.archivers.sevenz.SevenZArchiveEntry;
import org.apache.commons.compress.utils.ArchiveUtils;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;

import org.apache.commons.compress.archivers.sevenz.SevenZArchiveEntry;
import org.apache.commons.compress.utils.ArchiveUtils;
import org.junit.jupiter.api.Test;

public class ArchiveUtilsTest extends AbstractTestCase {

private static final int bytesToTest = 50;
@@ -74,6 +75,7 @@ public void testAsciiConversions() {

@Test
public void sanitizeShortensString() {
// @formatter:off
final String input = "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
@@ -84,6 +86,7 @@ public void sanitizeShortensString() {
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901...";
// @formatter:on
assertEquals(expected, ArchiveUtils.sanitize(input));
}

@@ -140,11 +143,8 @@ public void testIsEqual() {

@Test
public void testToAsciiStringThrowsStringIndexOutOfBoundsException() {

final byte[] byteArray = new byte[3];

ArchiveUtils.toAsciiString(byteArray, 940, 2730);

assertThrows(StringIndexOutOfBoundsException.class, () -> ArchiveUtils.toAsciiString(byteArray, 940, 2730));
}

private void asciiToByteAndBackOK(final String inputString) {

0 comments on commit dce8954

Please sign in to comment.