Skip to content

Commit

Permalink
Merge pull request #841 from mP1/feature/ExpressionEvaluationContextT…
Browse files Browse the repository at this point in the history
…esting-member-grouping

ExpressionEvaluationContextTesting member grouping
  • Loading branch information
mP1 authored Jan 11, 2025
2 parents afeff2c + caaa7ca commit d2af877
Showing 1 changed file with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public interface ExpressionEvaluationContextTesting<C extends ExpressionEvaluati
ExpressionPurityContextTesting<C>,
TreePrintableTesting {

// evaluate.........................................................................................................

@Test
default void testEvaluateNullExpressionFails() {
assertThrows(
Expand Down Expand Up @@ -80,6 +82,8 @@ default void toValueAndCheck(final Expression node, final ExpressionEvaluationCo
() -> "Expression.toValue failed, node=" + node + " context=" + context);
}

// expressionFunction...............................................................................................

@Test
default void testExpressionFunctionWithNullFunctionNameFails() {
assertThrows(
Expand Down Expand Up @@ -113,15 +117,6 @@ default void testEvaluateFunctionNullParametersFails() {
);
}

@Test
default void testReferenceNullReferenceFails() {
assertThrows(
NullPointerException.class,
() -> this.createContext()
.reference(null)
);
}

default <T> void evaluateFunctionAndCheck(final ExpressionFunction<T, C> function,
final List<Object> parameters,
final T expected) {
Expand All @@ -145,6 +140,19 @@ default <T> void evaluateFunctionAndCheck(final C context,
);
}

// reference........................................................................................................

@Test
default void testReferenceNullReferenceFails() {
assertThrows(
NullPointerException.class,
() -> this.createContext()
.reference(null)
);
}

// ExpressionEvaluationContext......................................................................................

@Override
default C createCanConvert() {
return this.createContext();
Expand Down

0 comments on commit d2af877

Please sign in to comment.