File tree Expand file tree Collapse file tree 3 files changed +72
-0
lines changed
src/test/java/liquidjava/rj_language/opt Expand file tree Collapse file tree 3 files changed +72
-0
lines changed Original file line number Diff line number Diff line change 9595 </execution >
9696 </executions >
9797 </plugin >
98+
99+ <plugin >
100+ <groupId >org.jacoco</groupId >
101+ <artifactId >jacoco-maven-plugin</artifactId >
102+ <version >0.8.14</version >
103+ <executions >
104+ <execution >
105+ <id >default-prepare-agent</id >
106+ <goals >
107+ <goal >prepare-agent</goal >
108+ </goals >
109+ </execution >
110+ <execution >
111+ <id >default-report</id >
112+ <goals >
113+ <goal >report</goal >
114+ </goals >
115+ </execution >
116+ <execution >
117+ <id >default-check</id >
118+ <goals >
119+ <goal >check</goal >
120+ </goals >
121+ <configuration >
122+ <rules >
123+ <rule >
124+ <element >BUNDLE</element >
125+ <limits >
126+ <limit >
127+ <counter >COMPLEXITY</counter >
128+ <value >COVEREDRATIO</value >
129+ <minimum >0.60</minimum >
130+ </limit >
131+ </limits >
132+ </rule >
133+ </rules >
134+ </configuration >
135+ </execution >
136+ </executions >
137+ </plugin >
98138 </plugins >
99139 </build >
100140
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+ package liquidjava .ast .opt ;
2+
3+ import static org .junit .Assert .assertEquals ;
4+ import org .junit .Test ;
5+
6+ import liquidjava .rj_language .ast .BinaryExpression ;
7+ import liquidjava .rj_language .ast .LiteralInt ;
8+ import liquidjava .rj_language .opt .ConstantFolding ;
9+ import liquidjava .rj_language .opt .derivation_node .ValDerivationNode ;
10+
11+ public class TestOptimization {
12+ @ Test
13+ public void testBinaryFold () {
14+ BinaryExpression b = new BinaryExpression (new LiteralInt (1 ), "+" , new LiteralInt (2 ));
15+ ValDerivationNode r = ConstantFolding .fold (new ValDerivationNode (b , null ));
16+ assertEquals (new LiteralInt (3 ), r .getValue ());
17+ }
18+ }
You can’t perform that action at this time.
0 commit comments