File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
liquidjava-verifier/src/test/java/liquidjava Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 55
66import liquidjava .rj_language .ast .BinaryExpression ;
77import liquidjava .rj_language .ast .LiteralInt ;
8+ import liquidjava .rj_language .ast .UnaryExpression ;
89import liquidjava .rj_language .opt .ConstantFolding ;
910import liquidjava .rj_language .opt .derivation_node .ValDerivationNode ;
1011
@@ -17,4 +18,11 @@ public void testBinaryFold() {
1718 ValDerivationNode r = ConstantFolding .fold (new ValDerivationNode (b , null ));
1819 assertEquals (r .getValue (), new LiteralInt (3 ));
1920 }
21+
22+ @ Test
23+ public void testUnaryExpression () {
24+ UnaryExpression u = new UnaryExpression ("-" , new LiteralInt (3 ));
25+ ValDerivationNode vd = ConstantFolding .fold (new ValDerivationNode (u , null ));
26+ assertEquals (vd .getValue (), new LiteralInt (-3 ));
27+ }
2028}
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+
6+ import liquidjava .rj_language .ast .LiteralBoolean ;
7+
8+ public class testLiteralBoolean {
9+
10+ @ Test
11+ public void testLiteralBoolean () {
12+ LiteralBoolean s1 = new LiteralBoolean (true );
13+ LiteralBoolean s2 = new LiteralBoolean (false );
14+ assertNotEquals (s1 .hashCode (), s2 .hashCode ());
15+ }
16+ }
You can’t perform that action at this time.
0 commit comments