Unit tests live in the core module and test pure Java classes without Minecraft runtime dependencies.
-
RefStringsTest - Tests mod constants
testModId()- Validates RefStrings.MODID valuetestModName()- Validates RefStrings.NAME valuetestModVersion()- Validates RefStrings.VERSION value
-
SortModeTest - Tests sort mode enum behavior
- Validates display names, rotation, and comparator logic
-
ExtractListModeTest - Tests extract list mode enum behavior
- Validates display names, descriptions, and rotation
-
SecurityBoxTest - Tests security box data structures
# Run common module unit tests
./gradlew :core:test
# Run tests with clean build
./gradlew :core:clean :core:test
# View test report
open core/build/reports/tests/test/index.html- Total Tests: 4 test classes
- Passing: All
- Location:
core/src/test/java/
- Tests live in the
coremodule alongside the platform-agnostic code they test - Only pure Java classes without Minecraft runtime dependencies can be unit tested
- Registration classes (in
neoforgemodule) depend on NeoForge APIs and cannot be unit tested - NeoForge game tests (in
neoforge/.../gametest/) provide integration-level testing