mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-01-26 23:50:23 +07:00
Tests for random seed serialization
This commit is contained in:
parent
983552fe01
commit
9db87b166e
18
core/src/test/java/com/riiablo/map2/random/SeedTest.java
Normal file
18
core/src/test/java/com/riiablo/map2/random/SeedTest.java
Normal file
@ -0,0 +1,18 @@
|
||||
package com.riiablo.map2.random;
|
||||
|
||||
import org.junit.jupiter.api.*;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import com.badlogic.gdx.math.MathUtils;
|
||||
|
||||
class SeedTest {
|
||||
@RepeatedTest(10)
|
||||
void encode() {
|
||||
long seed0 = MathUtils.random.nextLong();
|
||||
long seed1 = MathUtils.random.nextLong();
|
||||
String encoding = Seed.encode(seed0, seed1);
|
||||
Seed seed = Seed.decode(encoding);
|
||||
assertEquals(seed0, seed.seed0);
|
||||
assertEquals(seed1, seed.seed1);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user