Skip to content

Commit

Permalink
Update assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
seadowg committed Jan 24, 2024
1 parent 349239d commit df9980e
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/test/java/org/javarosa/core/model/SelectCachingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import static java.util.Arrays.asList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.lessThan;
import static org.hamcrest.Matchers.equalTo;
import static org.javarosa.core.util.BindBuilderXFormsElement.bind;
import static org.javarosa.core.util.XFormsElement.body;
import static org.javarosa.core.util.XFormsElement.head;
Expand Down Expand Up @@ -54,8 +54,8 @@ public void eqChoiceFiltersAreOnlyEvaluatedOnceForRepeatedChoiceListEvaluations(
scenario.choicesOf("/data/select");
});

// Check that we do less than (size of secondary instance) * (number of choice lookups)
assertThat(evaluations, lessThan(4));
// Check that we do just (size of secondary instance)
assertThat(evaluations, equalTo(2));
}

@Test
Expand Down Expand Up @@ -92,8 +92,8 @@ public void repeatedEqChoiceFiltersAreOnlyEvaluatedOnce_whileLiteralExpressionIs
scenario.choicesOf("/data/select2");
});

// Check that we do less than (size of secondary instance) * (number of choice lookups)
assertThat(evaluations, lessThan(4));
// Check that we do just (size of secondary instance)
assertThat(evaluations, equalTo(2));
}

@Test
Expand Down Expand Up @@ -130,8 +130,8 @@ public void repeatedCompChoiceFiltersAreOnlyEvaluatedOnce_whileLiteralExpression
scenario.choicesOf("/data/select2");
});

// Check that we do less than (size of secondary instance) * (number of choice lookups)
assertThat(evaluations, lessThan(4));
// Check that we do just (size of secondary instance)
assertThat(evaluations, equalTo(2));
}

@Test
Expand Down Expand Up @@ -169,8 +169,8 @@ public void repeatedEqChoiceFiltersAreOnlyEvaluatedOnce() throws Exception {
scenario.choicesOf("/data/select2");
});

// Check that we do less than (size of secondary instance) * (number of choice lookups)
assertThat(evaluations, lessThan(4));
// Check that we do just (size of secondary instance)
assertThat(evaluations, equalTo(2));
}

//region repeats
Expand Down Expand Up @@ -206,8 +206,8 @@ public void eqChoiceFilter_inRepeat_onlyEvaluatedOnce() throws Exception {
scenario.choicesOf("/data/repeat[1]/select");
});

// Check that we do less than (size of secondary instance) * (number of choice lookups)
assertThat(evaluations, lessThan(8));
// Check that we do just (size of secondary instance)
assertThat(evaluations, equalTo(4));
}

@Test
Expand Down Expand Up @@ -244,8 +244,8 @@ public void eqChoiceFiltersInRepeatsWithCurrentPathExpressionsAreOnlyEvaluatedOn
scenario.choicesOf("/data/outer[0]/inner[1]/select");
});

// Check that we do less than (size of secondary instance) * (number of choice lookups)
assertThat(evaluations, lessThan(4));
// Check that we do just (size of secondary instance)
assertThat(evaluations, equalTo(2));
}
//endregion
}

0 comments on commit df9980e

Please sign in to comment.