Adventure

Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Yannick Lamprecht <yannicklamprecht@live.de>
This commit is contained in:
Riley Park
2021-01-29 17:21:55 +01:00
parent 8888031206
commit 15081a5912
70 changed files with 3298 additions and 160 deletions

View File

@@ -0,0 +1,31 @@
package io.papermc.paper.adventure;
import java.util.HashSet;
import java.util.Set;
import net.kyori.adventure.key.Key;
import org.bukkit.NamespacedKey;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class KeyTest {
@Test
public void equalsTest() {
Key key = new NamespacedKey("test", "key");
Key key1 = Key.key("test", "key");
assertEquals(key, key1);
assertEquals(key1, key);
}
@Test
public void setTest() {
Key key = new NamespacedKey("test", "key");
Key key1 = Key.key("test", "key");
Set<Key> set = new HashSet<>(Set.of(key));
Set<Key> set1 = new HashSet<>(Set.of(key1));
assertTrue(set.contains(key1));
assertTrue(set1.contains(key));
}
}