mirror of
https://github.com/TheAlgorithms/Java.git
synced 2026-03-13 08:40:43 +08:00
Format code with prettier (#3375)
This commit is contained in:
@@ -1,32 +1,31 @@
|
||||
package com.thealgorithms.backtracking;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class PermutationTest {
|
||||
|
||||
@Test
|
||||
void testNoElement()
|
||||
{
|
||||
List<Integer []> result = Permutation.permutation(new Integer[]{});
|
||||
void testNoElement() {
|
||||
List<Integer[]> result = Permutation.permutation(new Integer[] {});
|
||||
assertEquals(result.get(0).length, 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSingleElement()
|
||||
{
|
||||
List<Integer []> result = Permutation.permutation(new Integer[]{1});
|
||||
void testSingleElement() {
|
||||
List<Integer[]> result = Permutation.permutation(new Integer[] { 1 });
|
||||
assertEquals(result.get(0)[0], 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testMultipleElements()
|
||||
{
|
||||
List<Integer []> result = Permutation.permutation(new Integer[]{1, 2});
|
||||
assertTrue(Arrays.equals(result.get(0), new Integer[]{1,2}));
|
||||
assertTrue(Arrays.equals(result.get(1), new Integer[]{2,1}));
|
||||
void testMultipleElements() {
|
||||
List<Integer[]> result = Permutation.permutation(
|
||||
new Integer[] { 1, 2 }
|
||||
);
|
||||
assertTrue(Arrays.equals(result.get(0), new Integer[] { 1, 2 }));
|
||||
assertTrue(Arrays.equals(result.get(1), new Integer[] { 2, 1 }));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user