@Test
    public void testSegments() {
        assertMetrics("segments:1","a","a");
        assertMetrics("segments:1","a b c","a b c");
        assertMetrics("segments:1","a b c","a x x b c");
        assertMetrics("segments:2","a b c","a x x x x x x x x x x x x x x x x x x x b c");
        assertMetrics("segments:2","a b c","b c x x x x x x x x x x x x x x x x x x x a");
        assertMetrics("segments:2 gaps:1","a b c","x x x a x x x x x x x x x x x x x x x x x x x b x x c x x");
        assertMetrics("segments:2 gaps:0 outOfOrder:0","a b c","b c x x x x x x x x x x x x x x x x x x x a");
        assertMetrics("segments:2 gaps:1","a b c","x x x b x x c x x x x x x x x x x x x x x x x x x x a x x");
        assertMetrics("segments:2 gaps:1","a y y b c","x x x b x x c x x x x x x x x x x x x x x x x x x x a x x");
    }
Tests of calculation of all the string match metrics.
Add true as the fourth parameter to assertMetrics to see a trace of what the test is doing.

@author bratseth
searchlib/src/test/java/com/yahoo/searchlib/ranking/features/fieldmatch/test/FieldMatchMetricsTestCase.java