@Test
    public void requireThatStatementsBeforeOneThatConsidersInputAreKept() {
        assertNotOptimized("input foo | random");
        assertNotOptimized("input foo | trim + now");
        assertNotOptimized("input foo | (trim + now) - now");
        assertNotOptimized("input foo | (now . trim)");
        assertNotOptimized("input foo | (trim)");
        assertNotOptimized("input foo | (trim | trim)");
        assertNotOptimized("input foo | switch {case 'bar': now; case 'foo': now; }");
        assertNotOptimized("{ input test | { summary test; }; }");
        assertNotOptimized("1 | set_var foo | 0 | set_var bar");
        assertNotOptimized("1 | index foo | 0 | index bar");
        assertNotOptimized("1 | echo | 0 | echo");
        assertNotOptimized("'foo' | if (1 < 2) { now | summary } else { 42 | summary } | summary");
        assertNotOptimized("{ 0 | set_var tmp; " +
                           "  input foo | split ';' | for_each { to_int + get_var tmp | set_var tmp };" +
                           "  get_var tmp | attribute bar; }");
        assertNotOptimized("0 | set_var tmp | " +
                           "input foo | split ';' | for_each { to_int + get_var tmp | set_var tmp } | " +
                           "get_var tmp | attribute bar");
    }
@author <a href="mailto:magnarn@yahoo-inc.com">Magnar Nedland</a>
indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/ExpressionOptimizerTestCase.java