msokolov commented on code in PR #12029:
URL: https://github.com/apache/lucene/pull/12029#discussion_r1058588307


##########
lucene/core/src/test/org/apache/lucene/search/TestKnnByteVectorQuery.java:
##########
@@ -73,6 +73,14 @@ public void testToString() {
     assertEquals("KnnByteVectorQuery:f1[0,...][10]", q1.toString("ignored"));
   }
 
+  public void testGetTarget() {
+    byte[] queryVectorBytes = floatToBytes(new float[] {0, 1});
+    BytesRef targetQueryVector = new BytesRef(queryVectorBytes);
+    KnnByteVectorQuery q1 = new KnnByteVectorQuery("f1", queryVectorBytes, 10);
+
+    assertEquals(targetQueryVector, q1.getTargetCopy());

Review Comment:
   Let's also assert that it's not the *same* BytesRef; i.e. enforce making a 
copy.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to