Skip to content

Commit ae0a575

Browse files
author
Giuseppe Cannella
committed
Merge branch 'release/0.0.2'
2 parents ed47e07 + b8235e0 commit ae0a575

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

src/main/scala/com/github/gekomad/regexcollection/Validator.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ trait AsciiString
9494
trait Celsius
9595
trait Fahrenheit
9696
trait HtmlHref
97-
trait HtmlImg
9897

9998
object Collection {
10099

@@ -159,7 +158,6 @@ object Collection {
159158
Validator[Email]("""[a-zA-Z0-9\.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*""")
160159

161160
implicit val validatorEmailSimple: Validator[EmailSimple] = Validator[EmailSimple](""".+@.+\..+""")
162-
implicit val validatorHtmlImg: Validator[HtmlImg] = Validator[HtmlImg]("""<img>.*<\/img>|<img.*[<\/img>|\/>]+""")
163161
implicit val validatorHref: Validator[HtmlHref] = Validator[HtmlHref]("""href=[\"\'](http[s]?:\/\/|\.\/|\/)?\w+(\.\w+)*(\/\w+(\.\w+)?)*(\/|\?\w*=\w*(&\w*=\w*)*)?[\"\']""")
164162
implicit val validatorEmail1: Validator[Email1] = Validator[Email1]("""[_&A-Za-z0-9-\+]+(\.[_A-Za-z0-9-]+)*@[_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*(\.[A-Za-z]{2,})""")
165163
implicit val validatorFacebook: Validator[Facebook] = Validator[Facebook]("""https:\/\/(www|[a-zA-Z]{2}-[a-zA-Z]{2})\.facebook\.com\/(pages\/[a-zA-Z0-9\.-]+\/[0-9]+|[a-zA-Z0-9\.-]+)[\/]?""")

src/test/scala/Validate.scala

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,6 @@ class Validate extends FunSuite {
5252
assert(validate[HtmlHref]("""href="bad example"""") == None)
5353
}
5454

55-
test("HtmlImg") {
56-
import com.github.gekomad.regexcollection.Validate.validate
57-
import com.github.gekomad.regexcollection.HtmlImg
58-
59-
assert(
60-
validate[HtmlImg]("""<img alt="bar" height="178" src="https://www.aa.it/cce.jpg" width="316"/>"""") == Some("""<img alt="bar" height="178" src="https://www.aa.it/cce.jpg" width="316"/>"""")
61-
)
62-
assert(validate[HtmlImg]("""xxx"""") == Some("""xxx""""))
63-
assert(validate[HtmlImg]("""xxx"""") == Some("""xxx""""))
64-
assert(validate[HtmlImg]("""<a href="http://www.aaa.it/pxx/""""") == None)
65-
assert(
66-
validate[HtmlImg]("""<img alt="bar" height="178" src="https://www.aa.it/cce.jpg" width="316"/>"""") == Some("""<img alt="bar" height="178" src="https://www.aa.it/cce.jpg" width="316"/>"""")
67-
)
68-
assert(validate[HtmlImg]("""<h2 class="entry-title">"""") == Some("""<h2 class="entry-title">""""))
69-
assert(validate[HtmlImg]("aaaa") == None)
70-
71-
}
72-
7355
test("Email simple") {
7456
import com.github.gekomad.regexcollection.Validate.validate
7557
{ //custom email pattern

0 commit comments

Comments
 (0)