23 lines
593 B
Java
23 lines
593 B
Java
import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
import org.junit.Assert;
|
|
import org.junit.Test;
|
|
|
|
|
|
public class InsertionSortTest {
|
|
|
|
@Test
|
|
public void test() {
|
|
int[] arr = {9, 7, 6, 5, 4, 2, 1, 0};
|
|
int[] fin = {0, 1, 2, 4, 5, 6, 7, 9};
|
|
|
|
int[] komp={111111,94854,555,444,123};
|
|
int[] kompSort={123,444,555,94854,111111};
|
|
|
|
Assert.assertArrayEquals(InsertionSort.insertionSortLSG(arr), fin);
|
|
Assert.assertArrayEquals(InsertionSort.insertSort(arr), fin);
|
|
Assert.assertArrayEquals(InsertionSort.insertSort(komp), kompSort);
|
|
}
|
|
|
|
}
|