Skip to content

Commit

Permalink
Fix locale in FaissTests (#1082)
Browse files Browse the repository at this point in the history
Signed-off-by: John Mazanec <[email protected]>
  • Loading branch information
jmazanec15 authored Aug 31, 2023
1 parent ce47b1b commit c6ac0fc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/test/java/org/opensearch/knn/index/util/FaissTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import java.io.IOException;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;

import static org.opensearch.knn.common.KNNConstants.ENCODER_PARAMETER_PQ_CODE_SIZE;
Expand All @@ -35,7 +36,7 @@ public class FaissTests extends KNNTestCase {

public void testGetMethodAsMap_whenMethodIsHNSWFlat_thenCreateCorrectIndexDescription() throws IOException {
int mParam = 65;
String expectedIndexDescription = String.format("HNSW%d,Flat", mParam);
String expectedIndexDescription = String.format(Locale.ROOT, "HNSW%d,Flat", mParam);

XContentBuilder xContentBuilder = XContentFactory.jsonBuilder()
.startObject()
Expand All @@ -57,7 +58,7 @@ public void testGetMethodAsMap_whenMethodIsHNSWFlat_thenCreateCorrectIndexDescri
public void testGetMethodAsMap_whenMethodIsHNSWPQ_thenCreateCorrectIndexDescription() throws IOException {
int hnswMParam = 65;
int pqMParam = 17;
String expectedIndexDescription = String.format("HNSW%d,PQ%d", hnswMParam, pqMParam);
String expectedIndexDescription = String.format(Locale.ROOT, "HNSW%d,PQ%d", hnswMParam, pqMParam);

XContentBuilder xContentBuilder = XContentFactory.jsonBuilder()
.startObject()
Expand All @@ -84,7 +85,7 @@ public void testGetMethodAsMap_whenMethodIsHNSWPQ_thenCreateCorrectIndexDescript

public void testGetMethodAsMap_whenMethodIsIVFFlat_thenCreateCorrectIndexDescription() throws IOException {
int nlists = 88;
String expectedIndexDescription = String.format("IVF%d,Flat", nlists);
String expectedIndexDescription = String.format(Locale.ROOT, "IVF%d,Flat", nlists);

XContentBuilder xContentBuilder = XContentFactory.jsonBuilder()
.startObject()
Expand All @@ -107,7 +108,7 @@ public void testGetMethodAsMap_whenMethodIsIVFPQ_thenCreateCorrectIndexDescripti
int ivfNlistsParam = 88;
int pqMParam = 17;
int pqCodeSizeParam = 53;
String expectedIndexDescription = String.format("IVF%d,PQ%dx%d", ivfNlistsParam, pqMParam, pqCodeSizeParam);
String expectedIndexDescription = String.format(Locale.ROOT, "IVF%d,PQ%dx%d", ivfNlistsParam, pqMParam, pqCodeSizeParam);

XContentBuilder xContentBuilder = XContentFactory.jsonBuilder()
.startObject()
Expand Down

0 comments on commit c6ac0fc

Please sign in to comment.