mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-07 17:08:30 +01:00
Use assertEqualsSNBT
This commit is contained in:
parent
b5367ee96a
commit
d2e3055225
@ -4,7 +4,7 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static net.minestom.server.api.TestUtils.assertEqualsIgnoreSpace;
|
import static net.minestom.server.api.TestUtils.assertEqualsSNBT;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
public class TagStructureTest {
|
public class TagStructureTest {
|
||||||
@ -71,16 +71,16 @@ public class TagStructureTest {
|
|||||||
var handler = TagHandler.newHandler();
|
var handler = TagHandler.newHandler();
|
||||||
var entry = new Entry("hello");
|
var entry = new Entry("hello");
|
||||||
handler.setTag(STRUCTURE_TAG, entry);
|
handler.setTag(STRUCTURE_TAG, entry);
|
||||||
assertEqualsIgnoreSpace("""
|
assertEqualsSNBT("""
|
||||||
{
|
{
|
||||||
"entry": {
|
"entry": {
|
||||||
"value": "hello"
|
"value":"hello"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
""", handler.asCompound().toSNBT());
|
""", handler.asCompound());
|
||||||
|
|
||||||
handler.removeTag(STRUCTURE_TAG);
|
handler.removeTag(STRUCTURE_TAG);
|
||||||
assertEqualsIgnoreSpace("{}", handler.asCompound().toSNBT());
|
assertEqualsSNBT("{}", handler.asCompound());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -117,24 +117,24 @@ public class TagStructureTest {
|
|||||||
// Add first entry
|
// Add first entry
|
||||||
{
|
{
|
||||||
handler.setTag(STRUCTURE_TAG, entry1);
|
handler.setTag(STRUCTURE_TAG, entry1);
|
||||||
assertEqualsIgnoreSpace("""
|
assertEqualsSNBT("""
|
||||||
{
|
{
|
||||||
"entry": {
|
"entry": {
|
||||||
"value": "hello"
|
"value":"hello"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
""", handler.asCompound().toSNBT());
|
""", handler.asCompound());
|
||||||
}
|
}
|
||||||
// Add second entry
|
// Add second entry
|
||||||
{
|
{
|
||||||
handler.setTag(STRUCTURE_TAG2, entry2);
|
handler.setTag(STRUCTURE_TAG2, entry2);
|
||||||
assertEqualsIgnoreSpace("""
|
assertEqualsSNBT("""
|
||||||
{
|
{
|
||||||
"entry": {
|
"entry": {
|
||||||
"value2": "hello2"
|
"value2": "hello2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
""", handler.asCompound().toSNBT());
|
""", handler.asCompound());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,8 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static net.minestom.server.api.TestUtils.assertEqualsIgnoreSpace;
|
import static net.minestom.server.api.TestUtils.assertEqualsSNBT;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
|
||||||
|
|
||||||
public class TagViewTest {
|
public class TagViewTest {
|
||||||
|
|
||||||
@ -53,14 +52,14 @@ public class TagViewTest {
|
|||||||
var handler = TagHandler.newHandler();
|
var handler = TagHandler.newHandler();
|
||||||
var entry = new Entry("hello");
|
var entry = new Entry("hello");
|
||||||
handler.setTag(VIEW_TAG, entry);
|
handler.setTag(VIEW_TAG, entry);
|
||||||
assertEqualsIgnoreSpace("""
|
assertEqualsSNBT("""
|
||||||
{
|
{
|
||||||
"value": "hello"
|
"value":"hello"
|
||||||
}
|
}
|
||||||
""", handler.asCompound().toSNBT());
|
""", handler.asCompound());
|
||||||
|
|
||||||
handler.removeTag(VIEW_TAG);
|
handler.removeTag(VIEW_TAG);
|
||||||
assertEqualsIgnoreSpace("{}", handler.asCompound().toSNBT());
|
assertEqualsSNBT("{}", handler.asCompound());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user