@Test
    public void testCompleteness() {
        assertMetrics("completeness:1     queryCompleteness:1   fieldCompleteness:1",  "a","a");
        assertMetrics("completeness:0     queryCompleteness:0   fieldCompleteness:0",  "a","x");
        assertMetrics("completeness:0     queryCompleteness:0   fieldCompleteness:0",  "y","a");
        assertMetrics("completeness:0.975 queryCompleteness:1   fieldCompleteness:0.5","a","a a");
        assertMetrics("completeness:0.525 queryCompleteness:0.5 fieldCompleteness:1",  "a a","a");
        assertMetrics("completeness:1     queryCompleteness:1   fieldCompleteness:1",  "a b c","a b c");
        assertMetrics("completeness:0.525 queryCompleteness:0.5 fieldCompleteness:1",  "a b c d","a b");
        assertMetrics("completeness:0.975 queryCompleteness:1   fieldCompleteness:0.5","a b","a b c d");
        assertMetrics("completeness:0.97  queryCompleteness:1   fieldCompleteness:0.4","a b","a b c d e");
        assertMetrics("completeness:0.97  queryCompleteness:1   fieldCompleteness:0.4","a b","a b b b b");
    }
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