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
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ protected static int __compare(Comparable lv, Comparable rv, boolean convertStri
try {
if (lc == Boolean.class) {
if (convertStringExpressions && rc == String.class) {
lv = Boolean.valueOf((String) lv).booleanValue();
rv = Boolean.valueOf((String) rv);
} else {
return -1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,17 @@ public void testEvaluate_boolean() throws Exception {
eval(expression, context, Boolean.FALSE);
}

@Test
public void testEvaluate_booleanConstantComparedToStringProperty() throws Exception {
EvaluationContext trueContext = genContext(KeyValue.c("a", "true"));
EvaluationContext falseContext = genContext(KeyValue.c("a", "false"));

eval(genExp("TRUE=a"), trueContext, Boolean.TRUE);
eval(genExp("TRUE<>a"), falseContext, Boolean.TRUE);
eval(genExp("FALSE=a"), falseContext, Boolean.TRUE);
eval(genExp("FALSE<>a"), trueContext, Boolean.TRUE);
}

@Test
public void testEvaluate_equal() throws Exception {
Expression expression = genExp(equalExpression);
Expand Down
Loading