Has minimum length of


Definition

Return true if value length has minimum length of a value.

Usage

addRule("field -> min_length: 2")

Tests

@Test
public final void testRuleMinOk() throws Exception {
    UtilTest.testIt("min_length:3", "abcd", true);
    UtilTest.testIt("min_length:3", "ajknkjwnd", true);
    UtilTest.testIt("min_length:3", "11111111111111111111", true);
    UtilTest.testIt("min_length:0", "wdwdwdwdwa", true);
    UtilTest.testIt("min_length:0", " f eneo", true);
    UtilTest.testIt("min_length:0", ".", true);
}

@Test
public final void testRuleMinNotOk() throws Exception {
    UtilTest.testIt("min_length:3", "a", false);
    UtilTest.testIt("min_length:3", "", false);
    UtilTest.testIt("min_length:10", "abcdefg", false);
    UtilTest.testIt("min_length:10", " f eneo", false);
    UtilTest.testIt("min_length:10", "", false);
    UtilTest.testIt("min_length:10", "..", false);
}

results matching ""

    No results matching ""