Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added checkpointevents for subrecipes in compiler. #1767

Merged
merged 8 commits into from
Oct 1, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,10 @@ object RecipeCompiler {
isReprovider = i.isReprovider,
oldName = Option(i.originalName)
)
recipe.interactions.map(copyInteraction).toSet ++ recipe.sieves.map(convertSieveToInteraction) ++ recipe.subRecipes.flatMap(flattenSubRecipesToInteraction)
recipe.interactions.map(copyInteraction).toSet ++
recipe.sieves.map(convertSieveToInteraction) ++
recipe.subRecipes.flatMap(flattenSubRecipesToInteraction) ++
jwalgemoed marked this conversation as resolved.
Show resolved Hide resolved
recipe.checkpointEvents.map(convertCheckpointEventToInteraction)
}

val precompileErrors: Seq[String] = Assertions.preCompileAssertions(recipe)
Expand Down
3 changes: 2 additions & 1 deletion core/recipe-compiler/src/test/java/RecipeCompilerTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ public void shouldAddSubRecipe() {

Recipe subRecipe = new Recipe("SubRecipe")
.withSubRecipe(subSubRecipe)
.withCheckpointEvent(new CheckPointEvent("name"))
.withInteraction(InteractionDescriptor.of(InteractionA.class));


Expand All @@ -187,7 +188,7 @@ public void shouldAddSubRecipe() {
.map(i -> ((InteractionTransition) i).interactionName())
.collect(Collectors.toUnmodifiableList());

List<String> expected = java.util.List.of("$SubRecipe$SubRecipe$InteractionA", "$SubRecipe$SubSubRecipe$InteractionB");
List<String> expected = java.util.List.of("$SubRecipe$SubRecipe$InteractionA", "$CheckpointEventInteraction$name", "$SubRecipe$SubSubRecipe$InteractionB");

Assertions.assertEquals(expected, actual);
}
Expand Down
Loading