File tree Expand file tree Collapse file tree 3 files changed +72
-0
lines changed
src/test/java/liquidjava/rj_language Expand file tree Collapse file tree 3 files changed +72
-0
lines changed Original file line number Diff line number Diff line change 3838 <compilerTargetPlatform >20</compilerTargetPlatform >
3939 </configuration >
4040 </plugin >
41+
42+ <plugin >
43+ <groupId >org.jacoco</groupId >
44+ <artifactId >jacoco-maven-plugin</artifactId >
45+ <version >0.8.14</version >
46+ <executions >
47+ <execution >
48+ <id >default-prepare-agent</id >
49+ <goals >
50+ <goal >prepare-agent</goal >
51+ </goals >
52+ </execution >
53+ <execution >
54+ <id >default-report</id >
55+ <goals >
56+ <goal >report</goal >
57+ </goals >
58+ </execution >
59+ <execution >
60+ <id >default-check</id >
61+ <goals >
62+ <goal >check</goal >
63+ </goals >
64+ <configuration >
65+ <rules >
66+ <rule >
67+ <element >BUNDLE</element >
68+ <limits >
69+ <limit >
70+ <counter >COMPLEXITY</counter >
71+ <value >COVEREDRATIO</value >
72+ <minimum >0.60</minimum >
73+ </limit >
74+ </limits >
75+ </rule >
76+ </rules >
77+ </configuration >
78+ </execution >
79+ </executions >
80+ </plugin >
4181 <plugin >
4282 <groupId >org.apache.maven.plugins</groupId >
4383 <artifactId >maven-compiler-plugin</artifactId >
Original file line number Diff line number Diff line change 1+ package liquidjava .rj_language ;
2+
3+ import static org .junit .Assert .assertNotEquals ;
4+ import org .junit .Test ;
5+ import liquidjava .rj_language .ast .LiteralString ;
6+
7+ public class TestLiteralString {
8+ @ Test
9+ public void testLiteralString () {
10+ LiteralString s1 = new LiteralString ("hello" );
11+ LiteralString s2 = new LiteralString ("world" );
12+ assertNotEquals (s1 .hashCode (), s2 .hashCode ());
13+ }
14+ }
Original file line number Diff line number Diff line change 1+ import static org .junit .Assert .assertEquals ;
2+
3+ import org .junit .Test ;
4+
5+ import liquidjava .rj_language .ast .BinaryExpression ;
6+ import liquidjava .rj_language .ast .LiteralInt ;
7+ import liquidjava .rj_language .opt .ConstantFolding ;
8+ import liquidjava .rj_language .opt .derivation_node .ValDerivationNode ;
9+
10+ public class TestOptimization {
11+ @ Test
12+ public void testBinaryFold () {
13+ BinaryExpression b = new BinaryExpression (new LiteralInt (1 ), "+" , new LiteralInt (2 ));
14+
15+ ValDerivationNode r = ConstantFolding .fold (new ValDerivationNode (b , null ));
16+ assertEquals (r .getValue (), new LiteralInt (3 ));
17+ }
18+ }
You can’t perform that action at this time.
0 commit comments