Skip to content

Commit

Permalink
test: add Array2DUtil test
Browse files Browse the repository at this point in the history
  • Loading branch information
Flashky committed Dec 4, 2024
1 parent 7ab839e commit dd4a423
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/test/java/com/adventofcode/flashk/common/Array2DUtilTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.adventofcode.flashk.common;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

class Array2DUtilTest {

@Test
void transposeTest() {
char[][] array = {
{'a', 'b', 'c'},
{'d', 'e', 'f'},
{'g', 'h', 'i'}
};

char[][] expected = {
{'a', 'd', 'g'},
{'b', 'e', 'h'},
{'c', 'f', 'i'}
};

char[][] actual = Array2DUtil.transpose(array);

assertArrayEquals(expected, actual);
}
}

0 comments on commit dd4a423

Please sign in to comment.