@Test
    void testReferenceAsQueryString() {
        SearchDefinition sd = new SearchDefinition("test");
        sd.addIndex(new Index("someField"));
        IndexFacts facts = new IndexFacts(new IndexModel(sd));

        var profile = new QueryProfile("test");
        var registry = new QueryProfileRegistry();
        registry.register(profile);
        var query = new Query("?query=ref:", registry.compile().findQueryProfile("test"));
        query.getModel().setExecution(new Execution(Execution.Context.createContextStub(facts)));
        assertEquals("WEAKAND(100) ref", query.getModel().getQueryTree().getRoot().toString());
    }
Tests that the ref: here is not mistaken for a query profile reference.
container-search/src/test/java/com/yahoo/search/query/profile/test/QueryProfileTestCase.java