mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-06 16:37:38 +01:00
Add updateInner test
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
660112dca6
commit
7aec259520
@ -1,5 +1,6 @@
|
||||
package net.minestom.server.tag;
|
||||
|
||||
import net.minestom.server.coordinate.Vec;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static net.minestom.server.api.TestUtils.assertEqualsSNBT;
|
||||
@ -97,4 +98,18 @@ public class TagUpdateTest {
|
||||
});
|
||||
assertEquals(5, result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateInner() {
|
||||
var tag = Tag.Structure("vec", Vec.class);
|
||||
var tagX = Tag.Double("x").path("vec");
|
||||
var handler = TagHandler.newHandler();
|
||||
handler.setTag(tag, new Vec(5, 10, 15));
|
||||
handler.updateTag(tagX, x -> {
|
||||
assertEquals(5, x);
|
||||
return 7d;
|
||||
});
|
||||
assertEquals(7d, handler.getTag(tagX));
|
||||
assertEquals(new Vec(7, 10, 15), handler.getTag(tag));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user