summaryrefslogtreecommitdiff
path: root/src/test/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/org')
-rw-r--r--src/test/java/org/zwobble/hobgoblin/compiler/output/lang/rust/RustWriterTests.java6
-rw-r--r--src/test/java/org/zwobble/hobgoblin/compiler/output/lang/rust/ast/RustOuterAttributeMatcher.java6
2 files changed, 9 insertions, 3 deletions
diff --git a/src/test/java/org/zwobble/hobgoblin/compiler/output/lang/rust/RustWriterTests.java b/src/test/java/org/zwobble/hobgoblin/compiler/output/lang/rust/RustWriterTests.java
index b591058..62b361a 100644
--- a/src/test/java/org/zwobble/hobgoblin/compiler/output/lang/rust/RustWriterTests.java
+++ b/src/test/java/org/zwobble/hobgoblin/compiler/output/lang/rust/RustWriterTests.java
@@ -114,8 +114,8 @@ public class RustWriterTests {
var rust = RustStructStruct.arbitrary()
.withName(new RustIdentifier("Rectangle"))
.withAttributes(List.of(
- new RustOuterAttribute(RustTypePath.of("a", "b", "C")),
- new RustOuterAttribute(RustTypePath.of("Debug"))
+ new RustOuterAttribute(RustTypePath.of("a", "b", "C"), Optional.empty()),
+ new RustOuterAttribute(RustTypePath.of("derive"), Optional.of("(Debug)"))
))
.build();
@@ -123,7 +123,7 @@ public class RustWriterTests {
assertThat(string, equalTo("""
#[a::b::C]
- #[Debug]
+ #[derive(Debug)]
pub struct Rectangle {
}"""));
}
diff --git a/src/test/java/org/zwobble/hobgoblin/compiler/output/lang/rust/ast/RustOuterAttributeMatcher.java b/src/test/java/org/zwobble/hobgoblin/compiler/output/lang/rust/ast/RustOuterAttributeMatcher.java
index 6e1e930..7aceb9e 100644
--- a/src/test/java/org/zwobble/hobgoblin/compiler/output/lang/rust/ast/RustOuterAttributeMatcher.java
+++ b/src/test/java/org/zwobble/hobgoblin/compiler/output/lang/rust/ast/RustOuterAttributeMatcher.java
@@ -34,6 +34,12 @@ public class RustOuterAttributeMatcher implements org.zwobble.precisely.Matcher<
return new org.zwobble.hobgoblin.compiler.output.lang.rust.ast.RustOuterAttributeMatcher(submatchers);
}
+ public org.zwobble.hobgoblin.compiler.output.lang.rust.ast.RustOuterAttributeMatcher withInput(org.zwobble.precisely.Matcher<? super java.util.Optional<String>> input) {
+ var submatchers = new java.util.ArrayList<org.zwobble.precisely.Matcher<? super org.zwobble.hobgoblin.compiler.output.lang.rust.ast.RustOuterAttribute>>(this.submatchers);
+ submatchers.add(org.zwobble.precisely.Matchers.has("input", org.zwobble.hobgoblin.compiler.output.lang.rust.ast.RustOuterAttribute::input, input));
+ return new org.zwobble.hobgoblin.compiler.output.lang.rust.ast.RustOuterAttributeMatcher(submatchers);
+ }
+
// Custom area start: org.zwobble.hobgoblin.compiler.output.lang.rust.ast.RustOuterAttributeMatcher body
// Custom area end: org.zwobble.hobgoblin.compiler.output.lang.rust.ast.RustOuterAttributeMatcher body
}