@Test
    public void testClearValueUpdate() {
        String script = """
                        {
                        clear_state | guard { input string1 | tokenize normalize stem:"BEST" | summary string1 | index string1; }
                        }
                        """;

        var tester = new ScriptTester();
        var expression = tester.scriptFrom(script);

        DocumentType docType = new DocumentType("my_type");
        Field field1 = new Field("string1", DataType.STRING);
        Field field2 = new Field("string2", DataType.STRING);
        Field field3 = new Field("string3", DataType.STRING);
        docType.addField(field1);
        docType.addField(field2);
        docType.addField(field3);

        DocumentUpdate update = new DocumentUpdate(docType, "id:foo:my_type::1");
        update.addFieldUpdate(FieldUpdate.createClear(field1));

        FieldValuesFactory factory = new FieldValuesFactory();
        List<UpdateFieldValues> updates = factory.asFieldValues(update);

        expression.resolve(update);
        for (var fieldValueUpdate : updates)
            expression.execute(fieldValueUpdate);

        var update1 = updates.get(0).getOutput().getFieldUpdate("string1").getValueUpdate(0);
        assertTrue(update1 instanceof ClearValueUpdate);
    }
@author Simon Thoresen Hult
@author bratseth
indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/ScriptTestCase.java