@SuppressWarnings("unchecked")
    @Test
    public void testZCurveArray() throws ParseException {
        var expression = Expression.fromString("input location_str | for_each { to_pos } | for_each { zcurve } | attribute location_zcurve");

        SimpleTestAdapter adapter = new SimpleTestAdapter();
        adapter.createField(new Field("location_str", DataType.getArray(DataType.STRING)));
        var zcurveField = new Field("location_zcurve", DataType.getArray(DataType.LONG));
        adapter.createField(zcurveField);
        var array = new Array<StringFieldValue>(new ArrayDataType(DataType.STRING));
        array.add(new StringFieldValue("30;40"));
        array.add(new StringFieldValue("50;60"));
        adapter.setValue("location_str", array);

        expression.resolve(new TypeContext(adapter));

        ExecutionContext context = new ExecutionContext(adapter);
        expression.execute(context);
        assertTrue(adapter.values.containsKey("location_zcurve"));
        var longArray = (Array<LongFieldValue>)adapter.values.get("location_zcurve");
        assertEquals(  2516, longArray.get(0).getLong());
        assertEquals(4004, longArray.get(1).getLong());
    }
@author Simon Thoresen Hult
@author bratseth
indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/ScriptTestCase.java