summaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/zwobble/hobgoblin/compiler/output/generators/javapreciselymatchers/JavaPreciselyMatchersGenerator.java23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/javapreciselymatchers/JavaPreciselyMatchersGenerator.java b/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/javapreciselymatchers/JavaPreciselyMatchersGenerator.java
index 0a85c95..46d68ef 100644
--- a/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/javapreciselymatchers/JavaPreciselyMatchersGenerator.java
+++ b/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/javapreciselymatchers/JavaPreciselyMatchersGenerator.java
@@ -105,7 +105,13 @@ public class JavaPreciselyMatchersGenerator implements Generator {
JavaTypeRef.topLevel(List.of("org", "zwobble", "precisely"), "MatchResult"),
List.of(new JavaParam(JavaTypeRef.OBJECT, "actual")),
new JavaBlock(List.of(
- new JavaReturn(new JavaNullLiteral())
+ new JavaReturn(
+ new JavaMethodCall(
+ new JavaMethodCall(new JavaRef("this"), "toMatcher", List.of()),
+ "match",
+ List.of(new JavaRef("actual"))
+ )
+ )
))
),
new JavaMethodDeclaration(
@@ -114,6 +120,21 @@ public class JavaPreciselyMatchersGenerator implements Generator {
JavaTypeRef.topLevel(List.of("org", "zwobble", "precisely"), "TextTree"),
List.of(),
new JavaBlock(List.of(
+ new JavaReturn(
+ new JavaMethodCall(
+ new JavaMethodCall(new JavaRef("this"), "toMatcher", List.of()),
+ "describe",
+ List.of()
+ )
+ )
+ ))
+ ),
+ new JavaMethodDeclaration(
+ "toMatcher",
+ JavaMethodKind.INSTANCE,
+ JavaTypeRef.topLevelGeneric(List.of("org", "zwobble", "precisely"), "Matcher", List.of(JavaTypeRef.OBJECT)),
+ List.of(),
+ new JavaBlock(List.of(
new JavaReturn(new JavaNullLiteral())
))
)