diff options
author | Jon Bratseth <bratseth@verizonmedia.com> | 2019-04-29 10:25:23 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@verizonmedia.com> | 2019-04-29 10:25:23 +0200 |
commit | 97fcbb11ff8e3ab2173fd09d0af071d06e6629e8 (patch) | |
tree | d106747dcaccd7cdf8b7941f828abbd4ed6cf6c6 /vespajlib/src/test | |
parent | 62b7463c18819588789fe2b848f64b01f3b84f90 (diff) |
Add a test and correct condition
Diffstat (limited to 'vespajlib/src/test')
-rw-r--r-- | vespajlib/src/test/java/com/yahoo/tensor/TensorTestCase.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/vespajlib/src/test/java/com/yahoo/tensor/TensorTestCase.java b/vespajlib/src/test/java/com/yahoo/tensor/TensorTestCase.java index 02d16e6f3e4..b01d171792c 100644 --- a/vespajlib/src/test/java/com/yahoo/tensor/TensorTestCase.java +++ b/vespajlib/src/test/java/com/yahoo/tensor/TensorTestCase.java @@ -37,6 +37,17 @@ public class TensorTestCase { } @Test + public void testValueTypes() { + assertEquals(Tensor.from("tensor<double>(x[1]):{{x:0}:5}").getClass(), IndexedDoubleTensor.class); + assertEquals(Tensor.Builder.of(TensorType.fromSpec("tensor<double>(x[1])")).cell(5.0, 0).build().getClass(), + IndexedDoubleTensor.class); + + assertEquals(Tensor.from("tensor<float>(x[1]):{{x:0}:5}").getClass(), IndexedFloatTensor.class); + assertEquals(Tensor.Builder.of(TensorType.fromSpec("tensor<float>(x[1])")).cell(5.0, 0).build().getClass(), + IndexedFloatTensor.class); + } + + @Test public void testParseError() { try { Tensor.from("--"); |