blob: ae13b95052b37c7c723db1c19ab79d4c6f22065d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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));
}
}
}
|