package com.muchencute.commons.regexp;

import junit.framework.Assert;
import junit.framework.TestCase;

import java.util.regex.Pattern;

import static com.muchencute.commons.regexp.RegexpUtils.*;

public class RegexpUtilsTest extends TestCase {

    public void testUsername() {

        Assert.assertTrue(Pattern.matches(USERNAME, "nothingmi"));
    }

    public void testPassword() {

        Assert.assertTrue(Pattern.matches(PASSWORD2, "hl74dxinF@4tBUg4v"));
        Assert.assertTrue(Pattern.matches(PASSWORD2, "abc123"));
        Assert.assertTrue(Pattern.matches(PASSWORD2, "Abc123"));
    }

    public void testEmail() {

        Assert.assertTrue(Pattern.matches(EMAIL, "nothingmi@muchencute.com"));
        Assert.assertTrue(Pattern.matches(EMAIL, "eileen.gu@cri-report.com"));
    }

    public void testPhone() {

        Assert.assertTrue(Pattern.matches(PHONE, "+8618620398354"));
        Assert.assertTrue(Pattern.matches(PHONE, "+86-18620398354"));
        Assert.assertTrue(Pattern.matches(PHONE, "+86-731-8993-2530"));
    }
}
@@ -780,24 +780,99 @@
 ort.com%22));%0A
+        Assert.assertTrue(Pattern.matches(EMAIL, %22eileen.gu@abc.com.co%22));%0A
     %7D%0A%0A    p

add test case