use of org.eclipse.core.internal.expressions.CountExpression in project eclipse.platform.runtime by eclipse.
the class CountExpressionTest method testNoneOrOneExpression.
public void testNoneOrOneExpression() throws CoreException {
// $NON-NLS-1$
CountExpression e = new CountExpression("?");
Assert.assertEquals(EvaluationResult.TRUE, e.evaluate(evaluationContext(0)));
Assert.assertEquals(EvaluationResult.TRUE, e.evaluate(evaluationContext(1)));
Assert.assertEquals(EvaluationResult.FALSE, e.evaluate(evaluationContext(2)));
}
use of org.eclipse.core.internal.expressions.CountExpression in project eclipse.platform.runtime by eclipse.
the class CountExpressionTest method testAnyNumberExpression.
public void testAnyNumberExpression() throws CoreException {
// $NON-NLS-1$
CountExpression e = new CountExpression("*");
Assert.assertEquals(EvaluationResult.TRUE, e.evaluate(evaluationContext(5)));
}
use of org.eclipse.core.internal.expressions.CountExpression in project eclipse.platform.runtime by eclipse.
the class CountExpressionTest method testGreaterThanExpression.
// @Test
// public void testGreaterThanOrEqualToExpression() throws CoreException {
// CountExpression e = new CountExpression("[3-"); //$NON-NLS-1$
// Assert.assertEquals(EvaluationResult.TRUE, e.evaluate(evaluationContext(5)));
// Assert.assertEquals(EvaluationResult.TRUE, e.evaluate(evaluationContext(3)));
// Assert.assertEquals(EvaluationResult.FALSE, e.evaluate(evaluationContext(2)));
// }
public void testGreaterThanExpression() throws CoreException {
// $NON-NLS-1$
CountExpression e = new CountExpression("(3-");
Assert.assertEquals(EvaluationResult.TRUE, e.evaluate(evaluationContext(5)));
Assert.assertEquals(EvaluationResult.FALSE, e.evaluate(evaluationContext(3)));
Assert.assertEquals(EvaluationResult.FALSE, e.evaluate(evaluationContext(2)));
}
use of org.eclipse.core.internal.expressions.CountExpression in project eclipse.platform.runtime by eclipse.
the class CountExpressionTest method testExactExpression.
public void testExactExpression() throws CoreException {
// $NON-NLS-1$
CountExpression e = new CountExpression("5");
Assert.assertEquals(EvaluationResult.TRUE, e.evaluate(evaluationContext(5)));
Assert.assertEquals(EvaluationResult.FALSE, e.evaluate(evaluationContext(7)));
}
use of org.eclipse.core.internal.expressions.CountExpression in project eclipse.platform.runtime by eclipse.
the class CountExpressionTest method testLessThanExpression.
// @Test
// public void testLessThanOrEqualToExpression() throws CoreException {
// CountExpression e = new CountExpression("-3]"); //$NON-NLS-1$
// Assert.assertEquals(EvaluationResult.TRUE, e.evaluate(evaluationContext(1)));
// Assert.assertEquals(EvaluationResult.TRUE, e.evaluate(evaluationContext(3)));
// Assert.assertEquals(EvaluationResult.FALSE, e.evaluate(evaluationContext(4)));
// }
public void testLessThanExpression() throws CoreException {
// $NON-NLS-1$
CountExpression e = new CountExpression("-3)");
Assert.assertEquals(EvaluationResult.TRUE, e.evaluate(evaluationContext(1)));
Assert.assertEquals(EvaluationResult.FALSE, e.evaluate(evaluationContext(3)));
Assert.assertEquals(EvaluationResult.FALSE, e.evaluate(evaluationContext(4)));
}
Aggregations