summaryrefslogtreecommitdiff
path: root/src/test/java/org/zwobble
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/org/zwobble')
-rw-r--r--src/test/java/org/zwobble/hobgoblin/compiler/output/lang/java/JavaWriterTests.java12
-rw-r--r--src/test/java/org/zwobble/hobgoblin/compiler/output/lang/java/ast/JavaUnsignedRightShiftMatcher.java45
2 files changed, 57 insertions, 0 deletions
diff --git a/src/test/java/org/zwobble/hobgoblin/compiler/output/lang/java/JavaWriterTests.java b/src/test/java/org/zwobble/hobgoblin/compiler/output/lang/java/JavaWriterTests.java
index aa0dc96..ff374fb 100644
--- a/src/test/java/org/zwobble/hobgoblin/compiler/output/lang/java/JavaWriterTests.java
+++ b/src/test/java/org/zwobble/hobgoblin/compiler/output/lang/java/JavaWriterTests.java
@@ -905,6 +905,18 @@ public class JavaWriterTests {
}
@Test
+ public void unsignedRightShift() throws IOException {
+ var java = JavaUnsignedRightShift.arbitrary()
+ .withLeft(JavaRef.arbitrary().withName(JavaIdentifier.of("x")))
+ .withRight(JavaRef.arbitrary().withName(JavaIdentifier.of("y")))
+ .build();
+
+ var string = write(writer -> writer.writeExpression(java));
+
+ assertThat(string, equalTo("x >>> y"));
+ }
+
+ @Test
public void typeRefWithoutArgsHasNoAngleBrackets() throws IOException {
var java = JavaTypeRef.topLevel(
JavaPackageName.of("abc", "def"),
diff --git a/src/test/java/org/zwobble/hobgoblin/compiler/output/lang/java/ast/JavaUnsignedRightShiftMatcher.java b/src/test/java/org/zwobble/hobgoblin/compiler/output/lang/java/ast/JavaUnsignedRightShiftMatcher.java
new file mode 100644
index 0000000..7da71c1
--- /dev/null
+++ b/src/test/java/org/zwobble/hobgoblin/compiler/output/lang/java/ast/JavaUnsignedRightShiftMatcher.java
@@ -0,0 +1,45 @@
+// Generated by hobgoblin.
+
+package org.zwobble.hobgoblin.compiler.output.lang.java.ast;
+
+// Custom area start: org.zwobble.hobgoblin.compiler.output.lang.java.ast.JavaUnsignedRightShiftMatcher imports
+// Custom area end: org.zwobble.hobgoblin.compiler.output.lang.java.ast.JavaUnsignedRightShiftMatcher imports
+
+public class JavaUnsignedRightShiftMatcher implements org.zwobble.precisely.Matcher<java.lang.Object> {
+ public static org.zwobble.hobgoblin.compiler.output.lang.java.ast.JavaUnsignedRightShiftMatcher isJavaUnsignedRightShift() {
+ return new org.zwobble.hobgoblin.compiler.output.lang.java.ast.JavaUnsignedRightShiftMatcher(java.util.List.of());
+ }
+
+ private final java.util.List<org.zwobble.precisely.Matcher<? super org.zwobble.hobgoblin.compiler.output.lang.java.ast.JavaUnsignedRightShift>> submatchers;
+
+ private JavaUnsignedRightShiftMatcher(java.util.List<org.zwobble.precisely.Matcher<? super org.zwobble.hobgoblin.compiler.output.lang.java.ast.JavaUnsignedRightShift>> submatchers) {
+ this.submatchers = submatchers;
+ }
+
+ public org.zwobble.precisely.MatchResult match(java.lang.Object actual) {
+ return this.toMatcher().match(actual);
+ }
+
+ public org.zwobble.precisely.TextTree describe() {
+ return this.toMatcher().describe();
+ }
+
+ private org.zwobble.precisely.Matcher<java.lang.Object> toMatcher() {
+ return org.zwobble.precisely.Matchers.instanceOf(org.zwobble.hobgoblin.compiler.output.lang.java.ast.JavaUnsignedRightShift.class, this.submatchers);
+ }
+
+ public org.zwobble.hobgoblin.compiler.output.lang.java.ast.JavaUnsignedRightShiftMatcher withLeft(org.zwobble.precisely.Matcher<? super org.zwobble.hobgoblin.compiler.output.lang.java.ast.JavaExpression> left) {
+ var submatchers = new java.util.ArrayList<org.zwobble.precisely.Matcher<? super org.zwobble.hobgoblin.compiler.output.lang.java.ast.JavaUnsignedRightShift>>(this.submatchers);
+ submatchers.add(org.zwobble.precisely.Matchers.has("left", org.zwobble.hobgoblin.compiler.output.lang.java.ast.JavaUnsignedRightShift::left, left));
+ return new org.zwobble.hobgoblin.compiler.output.lang.java.ast.JavaUnsignedRightShiftMatcher(submatchers);
+ }
+
+ public org.zwobble.hobgoblin.compiler.output.lang.java.ast.JavaUnsignedRightShiftMatcher withRight(org.zwobble.precisely.Matcher<? super org.zwobble.hobgoblin.compiler.output.lang.java.ast.JavaExpression> right) {
+ var submatchers = new java.util.ArrayList<org.zwobble.precisely.Matcher<? super org.zwobble.hobgoblin.compiler.output.lang.java.ast.JavaUnsignedRightShift>>(this.submatchers);
+ submatchers.add(org.zwobble.precisely.Matchers.has("right", org.zwobble.hobgoblin.compiler.output.lang.java.ast.JavaUnsignedRightShift::right, right));
+ return new org.zwobble.hobgoblin.compiler.output.lang.java.ast.JavaUnsignedRightShiftMatcher(submatchers);
+ }
+
+ // Custom area start: org.zwobble.hobgoblin.compiler.output.lang.java.ast.JavaUnsignedRightShiftMatcher body
+ // Custom area end: org.zwobble.hobgoblin.compiler.output.lang.java.ast.JavaUnsignedRightShiftMatcher body
+}