asset addressable PBS surface
This commit is contained in:
-12
@@ -16,8 +16,6 @@ class BackendClaimScopeSpecTest {
|
||||
"docs/specs/compiler/20. IRBackend to IRVM Lowering Specification.md";
|
||||
private static final String MATRIX_RELATIVE_PATH =
|
||||
"docs/specs/compiler/22. Backend Spec-to-Test Conformance Matrix.md";
|
||||
private static final String DECISION_RELATIVE_PATH =
|
||||
"docs/compiler/pbs/decisions/SPAWN-YIELD v1 Claim Rescope Decision.md";
|
||||
|
||||
@Test
|
||||
void loweringSpecMustDeclareSpawnYieldOutsideCoreV1ClaimScope() throws IOException {
|
||||
@@ -43,16 +41,6 @@ class BackendClaimScopeSpecTest {
|
||||
"G20-9.4.3 row must include explicit claim rescope note");
|
||||
}
|
||||
|
||||
@Test
|
||||
void decisionRecordMustExistForSpawnYieldClaimRescope() throws IOException {
|
||||
final var decisionPath = locateRepoRoot().resolve(DECISION_RELATIVE_PATH);
|
||||
assertTrue(Files.isRegularFile(decisionPath),
|
||||
"claim rescope decision is missing: " + decisionPath);
|
||||
final var content = Files.readString(decisionPath);
|
||||
assertTrue(content.contains("Trilha B"),
|
||||
"decision must record official Track B claim rescope choice");
|
||||
}
|
||||
|
||||
private Optional<String> findRequirementRow(
|
||||
final List<String> lines,
|
||||
final String requirementId) {
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package p.studio.compiler.workspaces;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.io.TempDir;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
class AssetSurfaceContextLoaderTest {
|
||||
|
||||
@TempDir
|
||||
Path tempDir;
|
||||
|
||||
@Test
|
||||
void shouldLoadOnlyIncludedAssetsAsAddressables() throws IOException {
|
||||
final var registryDir = tempDir.resolve("assets").resolve(".prometeu");
|
||||
Files.createDirectories(registryDir);
|
||||
Files.writeString(registryDir.resolve("index.json"), """
|
||||
{
|
||||
"schema_version": 1,
|
||||
"next_asset_id": 4,
|
||||
"assets": [
|
||||
{ "asset_id": 3, "root": "ui/atlas2", "included_in_build": true },
|
||||
{ "asset_id": 7, "root": "ui/one-more-atlas", "included_in_build": false },
|
||||
{ "asset_id": 8, "root": "ui/sound" }
|
||||
]
|
||||
}
|
||||
""");
|
||||
|
||||
final var surface = new AssetSurfaceContextLoader().load(tempDir);
|
||||
|
||||
assertEquals(2, surface.assets().size());
|
||||
assertEquals("assets.ui.atlas2", surface.assets().get(0).address());
|
||||
assertEquals(3, surface.assets().get(0).assetId());
|
||||
assertEquals("assets.ui.sound", surface.assets().get(1).address());
|
||||
assertEquals(8, surface.assets().get(1).assetId());
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldReturnEmptySurfaceWhenRegistryIsMissing() {
|
||||
final var surface = new AssetSurfaceContextLoader().load(tempDir);
|
||||
|
||||
assertTrue(surface.assets().isEmpty());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user