aboutsummaryrefslogtreecommitdiffstats
path: root/vespajlib/src/test/java/com/yahoo/tensor/impl/TensorAddressAnyTestCase.java
diff options
context:
space:
mode:
Diffstat (limited to 'vespajlib/src/test/java/com/yahoo/tensor/impl/TensorAddressAnyTestCase.java')
-rw-r--r--vespajlib/src/test/java/com/yahoo/tensor/impl/TensorAddressAnyTestCase.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/vespajlib/src/test/java/com/yahoo/tensor/impl/TensorAddressAnyTestCase.java b/vespajlib/src/test/java/com/yahoo/tensor/impl/TensorAddressAnyTestCase.java
new file mode 100644
index 00000000000..ae13b95052b
--- /dev/null
+++ b/vespajlib/src/test/java/com/yahoo/tensor/impl/TensorAddressAnyTestCase.java
@@ -0,0 +1,31 @@
+package com.yahoo.tensor.impl;
+
+import static com.yahoo.tensor.impl.TensorAddressAny.of;
+import static com.yahoo.tensor.TensorAddressTestCase.equal;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.jupiter.api.Test;
+
+public class TensorAddressAnyTestCase {
+ @Test
+ void testSize() {
+ for (int i = 0; i < 10; i++) {
+ int [] indexes = new int [i];
+ assertEquals(i, of(indexes).size());
+ }
+ }
+
+ @Test
+ void testNumericStringEquality() {
+ for (int i = 0; i < 10; i++) {
+ int [] numericIndexes = new int [i];
+ String [] stringIndexes = new String[i];
+ for (int j = 0; j < i; j++) {
+ numericIndexes[j] = j;
+ stringIndexes[j] = String.valueOf(j);
+ }
+ equal(of(stringIndexes), of(numericIndexes));
+ }
+ }
+
+}