@Test
    public void testEncodeIndexedShortForm() {
        assertEncodeShortForm("tensor(x[]):[1.0, 2.0]",
                              "{\"type\":\"tensor(x[])\",\"values\":[1.0,2.0]}");
        assertEncodeShortForm("tensor<float>(x[]):[1.0, 2.0]",
                              "{\"type\":\"tensor<float>(x[])\",\"values\":[1.0,2.0]}");
        assertEncodeShortForm("tensor(x[],y[]):[[1,2,3,4]]",
                              "{\"type\":\"tensor(x[],y[])\",\"values\":[[1.0,2.0,3.0,4.0]]}");
        assertEncodeShortForm("tensor(x[],y[]):[[1,2],[3,4]]",
                              "{\"type\":\"tensor(x[],y[])\",\"values\":[[1.0,2.0],[3.0,4.0]]}");
        assertEncodeShortForm("tensor(x[],y[]):[[1],[2],[3],[4]]",
                              "{\"type\":\"tensor(x[],y[])\",\"values\":[[1.0],[2.0],[3.0],[4.0]]}");
        assertEncodeShortForm("tensor(x[],y[],z[]):[[[1,2],[3,4]]]",
                              "{\"type\":\"tensor(x[],y[],z[])\",\"values\":[[[1.0,2.0],[3.0,4.0]]]}");
        assertEncodeShortForm("tensor(x[],y[],z[]):[[[1],[2],[3],[4]]]",
                              "{\"type\":\"tensor(x[],y[],z[])\",\"values\":[[[1.0],[2.0],[3.0],[4.0]]]}");
        assertEncodeShortForm("tensor(x[],y[],z[]):[[[1,2,3,4]]]",
                              "{\"type\":\"tensor(x[],y[],z[])\",\"values\":[[[1.0,2.0,3.0,4.0]]]}");
        assertEncodeShortForm("tensor(x[],y[],z[]):[[[1]],[[2]],[[3]],[[4]]]",
                              "{\"type\":\"tensor(x[],y[],z[])\",\"values\":[[[1.0]],[[2.0]],[[3.0]],[[4.0]]]}");
        assertEncodeShortForm("tensor(x[],y[],z[2]):[[[1, 2]],[[3, 4]]]",
                              "{\"type\":\"tensor(x[],y[],z[2])\",\"values\":[[[1.0,2.0]],[[3.0,4.0]]]}");
    }
Tests parsing of various tensor values set at the root, i.e. no 'cells', 'blocks' or 'values'
vespajlib/src/test/java/com/yahoo/tensor/serialization/JsonFormatTestCase.java