@Test
    public void failsWhenFormatterIsUnknownInsideConditional() {
        SimpleCodeWriter writer = new SimpleCodeWriter()
                .trimTrailingSpaces(false)
                .insertTrailingNewline(false);

        RuntimeException e = Assertions.assertThrows(RuntimeException.class, () -> {
            writer.write("${^foo}$P${/foo}", 10);
        });

        assertThat(e.getMessage(),
                equalTo("Syntax error at line 1 column 9: Unknown formatter `P` "
                        + "found in format string (template: ${^foo}$P${/foo}) "
                        + "(Debug Info {path=ROOT, near=})"));
    }
\n"
                                + " * Foo \"foo!\"\n"
                                + " *\n"
                                + " * \"baz\"!\n"
                                + " * Yap!\n"
                                + " *     This is indented, in flow of parent.\n"
                                + " *     Yap!\n"
                                + " *     Yap?\n"
                                + " *     # Has a prefix\n"
                                + " *     # Yes\n"
                                + "
smithy-utils/src/test/java/software/amazon/smithy/utils/CodeWriterTest.java