Skip to content

Commit

Permalink
Test MillModule.resolverDecoder
Browse files Browse the repository at this point in the history
  • Loading branch information
fthomas committed Jan 4, 2025
1 parent afa3143 commit 0f3ab16
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package org.scalasteward.core.buildtool.mill

import munit.FunSuite
import org.scalasteward.core.TestSyntax._
import org.scalasteward.core.data.Resolver

class MillDepParserTest extends FunSuite {
test("parse dependencies from https://github.com/lihaoyi/requests-scala") {
Expand Down Expand Up @@ -137,4 +138,13 @@ class MillDepParserTest extends FunSuite {

assertEquals(result.find(_.name == "requests[2.13.0]").map(_.dependencies), Some(dep13))
}

test("parse an IvyRepository") {
val pattern =
"https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)([branch]/)[revision]/[type]s/[artifact](-[classifier]).[ext]"
val json = s""" { "pattern": "$pattern", "type": "ivy", "headers": [] } """
val obtained = io.circe.parser.decode(json)(MillModule.resolverDecoder)
val expected = Right(Resolver.IvyRepository(pattern, pattern, None, Some(Nil)))
assertEquals(obtained, expected)
}
}

0 comments on commit 0f3ab16

Please sign in to comment.