-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: some improvements on palette & bitarray
- Loading branch information
Showing
4 changed files
with
51 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
server/src/test/java/org/allaymc/server/datastruct/palette/PaletteTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.allaymc.server.datastruct.palette; | ||
|
||
import org.allaymc.server.datastruct.bitarray.BitArrayVersion; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
/** | ||
* @author daoge_cmd | ||
*/ | ||
class PaletteTest { | ||
|
||
@Test | ||
void test() { | ||
var obj0 = new Object(); | ||
var palette = new Palette<>(obj0, BitArrayVersion.V0); | ||
assertEquals(obj0, palette.get(0)); | ||
|
||
var obj1 = new Object(); | ||
palette.set(1, obj1); | ||
assertEquals(obj1, palette.get(1)); | ||
|
||
var obj2 = new Object(); | ||
palette.set(2, obj2); | ||
assertEquals(obj2, palette.get(2)); | ||
|
||
// TODO: more tests | ||
} | ||
} |