Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions liquidjava-verifier/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,45 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.14</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>default-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>COMPLEXITY</counter>
<value>COVEREDRATIO</value>
<minimum>0.60</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import static org.junit.Assert.assertEquals;

import org.junit.Test;

import liquidjava.rj_language.ast.BinaryExpression;
import liquidjava.rj_language.ast.LiteralInt;
import liquidjava.rj_language.opt.ConstantFolding;
import liquidjava.rj_language.opt.derivation_node.ValDerivationNode;

public class TestOptimization {
@Test
public void testBinaryFold() {
BinaryExpression b = new BinaryExpression(new LiteralInt(1), "+", new LiteralInt(2));

ValDerivationNode r = ConstantFolding.fold(new ValDerivationNode(b, null));
assertEquals(r.getValue(), new LiteralInt(3));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package liquidjava.rj_language;

import static org.junit.Assert.assertNotEquals;
import org.junit.Test;
import liquidjava.rj_language.ast.LiteralInt;

public class TestLiteralInt {
@Test
public void testToString() {
LiteralInt n = new LiteralInt(61801);
assertEquals("61801", n.toString());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

package liquidjava.rj_language;

import static org.junit.Assert.assertNotEquals;
import org.junit.Test;
import liquidjava.rj_language.ast.LiteralString;

public class TestLiteralString {
@Test
public void testLiteralString() {
LiteralString s1 = new LiteralString("hello");
LiteralString s2 = new LiteralString("world");
assertNotEquals(s1.hashCode(), s2.hashCode());
}
}
Loading