Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Mar 29, 2024
2 parents e13ef9d + 784c33a commit df19bfc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -597,19 +597,11 @@ SOFTWARE.
<xsl:template match="class" mode="assert">
<xsl:param name="indent"/>
<xsl:value-of select="eo:tabs($indent)"/>
<xsl:text>Object obj = new Dataized(new </xsl:text>
<xsl:text>Boolean obj = new Dataized(new </xsl:text>
<xsl:value-of select="eo:class-name(@name, eo:suffix(@line, @pos))"/>
<xsl:text>()).take(Boolean.class);</xsl:text>
<xsl:value-of select="eo:eol(2 + $indent)"/>
<xsl:text>if (obj instanceof String) {</xsl:text>
<xsl:value-of select="eo:eol(2 + $indent)"/>
<xsl:text> Assertions.fail(obj.toString());</xsl:text>
<xsl:value-of select="eo:eol(2 + $indent)"/>
<xsl:text>} else {</xsl:text>
<xsl:value-of select="eo:eol(2 + $indent)"/>
<xsl:text> Assertions.assertTrue((Boolean) obj);</xsl:text>
<xsl:value-of select="eo:eol(2 + $indent)"/>
<xsl:text>}</xsl:text>
<xsl:text>Assertions.assertTrue(obj);</xsl:text>
</xsl:template>
<!-- Package -->
<xsl:template match="meta[head='package']" mode="head">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
xsls:
- /org/eolang/parser/add-default-package.xsl
- /org/eolang/maven/pre/classes.xsl
- /org/eolang/maven/pre/attrs.xsl
- /org/eolang/maven/pre/data.xsl
- /org/eolang/maven/pre/to-java.xsl
tests:
- /program/errors[count(*)=0]
- //java[contains(text(), ' @Test')]
- //java[contains(text(), ' public void works() throws java.lang.Exception {')]
- //java[contains(text(), ' Boolean obj = new Dataized(new EOcompares_two_bools()).take(Boolean.class);')]
- //java[contains(text(), ' Assertions.assertTrue(obj);')]
- //java[contains(text(), ' }')]
eo: |
+tests
+version 0.0.0
# Test.
[] > compares-two-bools
eq. > @
TRUE
TRUE

0 comments on commit df19bfc

Please sign in to comment.