Skip to content

Commit

Permalink
enum tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-buttner committed Mar 26, 2024
1 parent 463833c commit ad5e084
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.index.mapper.vectors.DenseVectorFieldMapper;
import org.elasticsearch.test.ESTestCase;

import static org.hamcrest.Matchers.is;
Expand Down Expand Up @@ -48,4 +49,12 @@ public void testTranslateToVersion_ReturnsFloat_WhenVersionOnByteEnumAddition_Wh
is(CohereEmbeddingType.FLOAT)
);
}

public void testFromElementType_CovertsFloatToCohereEmbeddingTypeFloat() {
assertThat(CohereEmbeddingType.fromElementType(DenseVectorFieldMapper.ElementType.FLOAT), is(CohereEmbeddingType.FLOAT));
}

public void testFromElementType_CovertsByteToCohereEmbeddingTypeByte() {
assertThat(CohereEmbeddingType.fromElementType(DenseVectorFieldMapper.ElementType.BYTE), is(CohereEmbeddingType.BYTE));
}
}

0 comments on commit ad5e084

Please sign in to comment.