Skip to content

Commit

Permalink
Merge pull request #32471 from vespa-engine/arnej/cosmetic-cleanup
Browse files Browse the repository at this point in the history
cleanup leftover and add another simple test
  • Loading branch information
arnej27959 authored Sep 26, 2024
2 parents f634d2e + 062e613 commit 782ba9d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion vespajlib/src/main/java/com/yahoo/tensor/TensorParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private static boolean fillFromBinaryValueString(IndexedTensor.DirectIndexBuilde
if (sz == 0
|| type.dimensions().isEmpty()
|| valueString.length() != numHexDigits
|| valueString.chars().anyMatch(ch -> (/*ch < numHexDigits && */ Character.digit(ch, 16) == -1)))
|| valueString.chars().anyMatch(ch -> (Character.digit(ch, 16) == -1)))
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ public void testMixedHexParsing() {
.cell(TensorAddress.ofLabels("b", "0"), 1.25)
.cell(TensorAddress.ofLabels("c", "0"), -19.125).build(),
Tensor.from("tensor<float>(key{}, x[1]):{a: 00000000, b:3FA00000, c: c1990000 }"));
assertEquals(Tensor.Builder.of(TensorType.fromSpec("tensor<float>(key{}, x[1])"))
.cell(TensorAddress.ofLabels("a", "0"), 0)
.cell(TensorAddress.ofLabels("b", "0"), 1.25)
.cell(TensorAddress.ofLabels("c", "0"), -19.125).build(),
Tensor.from("tensor<float>(key{}, x[1])", "{a: 00000000, b:3FA00000, c: c1990000 }"));
}

@Test
Expand Down

0 comments on commit 782ba9d

Please sign in to comment.