Skip to content

Commit

Permalink
Expand searchQuantity_Exponent test
Browse files Browse the repository at this point in the history
I meant to include this in my last commit for #2528...

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
  • Loading branch information
lmsurpre committed Jun 22, 2021
1 parent a250314 commit 0624eb1
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -777,9 +777,22 @@ public void testSearchQuantity_Range_missing() throws Exception {

@Test
public void testSearchQuantity_Exponent() throws Exception {
// Target value is 1.2E+2 (115-125)

// Value 1.2E+2 should return the value
// The value is extracted, and stored in the values tables.
assertSearchReturnsSavedResource("Quantity-withExponent", "1.2E+2");
assertSearchReturnsSavedResource( "Quantity-withExponent", "1.2E2");
assertSearchReturnsSavedResource( "Quantity-withExponent", "1.2E+2");
assertSearchReturnsSavedResource( "Quantity-withExponent", "1.2e2");
assertSearchReturnsSavedResource( "Quantity-withExponent", "1.2e+2");

assertSearchDoesntReturnSavedResource("Quantity-withExponent", "lt1e2");
assertSearchDoesntReturnSavedResource("Quantity-withExponent", "gt1e2");
assertSearchReturnsSavedResource( "Quantity-withExponent", "le1e2");
assertSearchReturnsSavedResource( "Quantity-withExponent", "ge1e2");
assertSearchDoesntReturnSavedResource("Quantity-withExponent", "sa1e2");
assertSearchDoesntReturnSavedResource("Quantity-withExponent", "eb1e2");
assertSearchReturnsSavedResource( "Quantity-withExponent", "ap1e2");

// Value 120 should not return the value since the range of 120
// (119.5-120.5) is smaller than the range of the indexed value
// 1.2E+2 (115-125) due to the difference in scale of those values.
Expand Down

0 comments on commit 0624eb1

Please sign in to comment.