mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-04 07:17:46 +01:00
SPIGOT-7653: Update ApiVersion.CURRENT with latest version and include tests
By: Doc <nachito94@msn.com>
This commit is contained in:
parent
f13c8f9203
commit
23b13ad11a
@ -15,7 +15,7 @@ public final class ApiVersion implements Comparable<ApiVersion> {
|
||||
|
||||
static {
|
||||
versions = new HashMap<>();
|
||||
CURRENT = getOrCreateVersion("1.20.5");
|
||||
CURRENT = getOrCreateVersion("1.20.6");
|
||||
FLATTENING = getOrCreateVersion("1.13");
|
||||
FIELD_NAME_PARITY = getOrCreateVersion("1.20.5");
|
||||
NONE = getOrCreateVersion("none");
|
||||
|
@ -2,12 +2,14 @@ package org.bukkit.craftbukkit.util;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import java.util.stream.Stream;
|
||||
import net.minecraft.SharedConstants;
|
||||
import org.bukkit.support.AbstractTestingBase;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
public class ApiVersionTest {
|
||||
public class ApiVersionTest extends AbstractTestingBase {
|
||||
|
||||
public static Stream<Arguments> parseData() {
|
||||
return Stream.of(
|
||||
@ -62,6 +64,14 @@ public class ApiVersionTest {
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCurrentVersionUpdated() {
|
||||
ApiVersion apiVersionOne = ApiVersion.getOrCreateVersion(SharedConstants.getCurrentVersion().getName());
|
||||
ApiVersion apiVersionTwo = ApiVersion.CURRENT;
|
||||
|
||||
assertEquals(apiVersionOne, apiVersionTwo, "The current version in ApiVersion not match current minecraft version");
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("parseData")
|
||||
public void testParsing(String parse, String expected) {
|
||||
|
Loading…
Reference in New Issue
Block a user