Skip to content

Commit

Permalink
WIP 49 - correct positions of build script files
Browse files Browse the repository at this point in the history
  • Loading branch information
bishabosha committed Sep 10, 2024
1 parent 49e1ffc commit a06daca
Show file tree
Hide file tree
Showing 3 changed files with 338 additions and 75 deletions.
27 changes: 20 additions & 7 deletions integration/failure/compile-error/src/CompileErrorTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,26 @@ object CompileErrorTests extends IntegrationTestSuite {
test {
val res = eval("foo.scalaVersion")

assert(res.isSuccess == false)
assert(res.err.contains("""bar.mill:15:9: not found: value doesntExist"""))
assert(res.err.contains("""println(doesntExist)"""))
assert(res.err.contains("""qux.mill:4:34: type mismatch;"""))
assert(res.err.contains(
"""build.mill:9:5: value noSuchMethod is not a member"""
))
assert(!res.isSuccess)

locally {
assert(res.err.contains("""bar.mill:15:9"""))
assert(res.err.contains("""println(doesntExist)"""))
assert(res.err.contains("""Not found: doesntExist"""))
}

locally {
assert(res.err.contains("""qux.mill:4:34"""))
assert(res.err.contains("""myMsg.substring("0")"""))
assert(res.err.contains("""Found: ("0" : String)"""))
assert(res.err.contains("""Required: Int"""))
}

locally {
assert(res.err.contains("""build.mill:9:5"""))
assert(res.err.contains("""foo.noSuchMethod"""))
assert(res.err.contains("""value noSuchMethod is not a member"""))
}
}
}
}
9 changes: 1 addition & 8 deletions scalalib/src/mill/scalalib/Assembly.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,8 @@ object Assembly {

private object Streamable {
def bytes(is: InputStream): Array[Byte] = {
val buffer = new Array[Byte](8192)
val out = new java.io.ByteArrayOutputStream
var read = 0
while ({
read = is.read(buffer)
read != -1
}) {
out.write(buffer, 0, read)
}
IO.stream(is, out)
out.close()
out.toByteArray
}
Expand Down
Loading

0 comments on commit a06daca

Please sign in to comment.