aboutsummaryrefslogtreecommitdiffstats
path: root/model-integration/src/test/java/ai/vespa/rankingexpression/importer/OrderedTensorTypeTestCase.java
blob: 34778a93abce1453159ffd1fcd146a99ac33e026 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.rankingexpression.importer;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * @author bratseth
 */
public class OrderedTensorTypeTestCase {

    @Test
    public void testToFromSpec() {
        String spec = "tensor(b[],c{},a[3])";
        String orderedSpec = "tensor(a[3],b[],c{})";
        OrderedTensorType type = OrderedTensorType.fromSpec(spec);
        assertEquals(orderedSpec, type.toString());
        assertEquals(orderedSpec, type.type().toString());
    }

}