diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustWriter.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustWriter.kt index e9bc8798cb..19a1262696 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustWriter.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustWriter.kt @@ -167,9 +167,10 @@ private fun transformTemplate(template: String, scope: Array { + sut.rustTemplate( + "#{Foo} #{Bar}", + "Foo Bar" to CargoDependency.Http.toType().resolve("foo"), + "Baz" to CargoDependency.Http.toType().resolve("foo"), + ) + } + exception.message shouldBe + """ + Rust block template expected `Foo` but was not present in template. + Hint: Template contains: [`Foo Bar`, `Baz`] + """.trimIndent() + } + @Test fun `can handle file paths properly when determining module`() { val sut = RustWriter.forModule("src/module_name")