aboutsummaryrefslogtreecommitdiffstats
path: root/vespajlib/src/test
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2023-12-15 10:41:44 +0100
committerGitHub <noreply@github.com>2023-12-15 10:41:44 +0100
commit684abb75b1967c2fa019d3454627ff95c3435aa8 (patch)
treefca3615e4bf729c721c99951ad006fc740e56f9c /vespajlib/src/test
parent9c8ba2608384ee79e143babd1e5a18a62166541f (diff)
parent0b137997746a2b467213b8e5fceea460813a868b (diff)
Merge pull request #29668 from vespa-engine/lesters/slice-dimension-with-space
Add string indicators for dimensions with spaces in slice tostring
Diffstat (limited to 'vespajlib/src/test')
-rw-r--r--vespajlib/src/test/java/com/yahoo/tensor/functions/SliceTestCase.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/vespajlib/src/test/java/com/yahoo/tensor/functions/SliceTestCase.java b/vespajlib/src/test/java/com/yahoo/tensor/functions/SliceTestCase.java
index 94a06a416a5..3a21017ded4 100644
--- a/vespajlib/src/test/java/com/yahoo/tensor/functions/SliceTestCase.java
+++ b/vespajlib/src/test/java/com/yahoo/tensor/functions/SliceTestCase.java
@@ -135,4 +135,13 @@ public class SliceTestCase {
.toString());
}
+ @Test
+ public void testLabelsWithSpaceToString() {
+ Tensor input = Tensor.from("tensor(key{}):{a:1, 'b c':2}");
+ assertEquals("tensor(key{}):{a:1.0, 'b c':2.0}{key:'b c'}",
+ new Slice<>(new ConstantTensor<>(input),
+ List.of(new Slice.DimensionValue<>("key", "b c")))
+ .toString());
+ }
+
}