Skip to content

Commit

Permalink
Add missing tests for Uri.toURL
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-lee committed Nov 1, 2024
1 parent 6f3849e commit d0bdcfc
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ trait networkCompatSpec {

def compatTests: List[Test] = List(
property("test Uri.toUrl", testUriToUrl),
property("test Uri.toURL", testUriToURL),
//
example("test Url(valid URL String)", testUrlApply),
example("test Url(URL)", testUrlApplyURL),
Expand Down Expand Up @@ -44,6 +45,17 @@ trait networkCompatSpec {
actual ==== expected
}

def testUriToURL: Property =
for {
uri <- networkGens.genUrlString.log("uri")
} yield {
@SuppressWarnings(Array("org.wartremover.warts.JavaNetURLConstructors"))
val expected = new URL(uri)
val actual = Uri.unsafeFrom(uri).toURL

actual ==== expected
}

//

def testUrlApply: Result = {
Expand Down

0 comments on commit d0bdcfc

Please sign in to comment.