Skip to content

Commit a06daca

Browse files
committed
WIP 49 - correct positions of build script files
1 parent 49e1ffc commit a06daca

File tree

3 files changed

+338
-75
lines changed

3 files changed

+338
-75
lines changed

integration/failure/compile-error/src/CompileErrorTests.scala

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,26 @@ object CompileErrorTests extends IntegrationTestSuite {
1111
test {
1212
val res = eval("foo.scalaVersion")
1313

14-
assert(res.isSuccess == false)
15-
assert(res.err.contains("""bar.mill:15:9: not found: value doesntExist"""))
16-
assert(res.err.contains("""println(doesntExist)"""))
17-
assert(res.err.contains("""qux.mill:4:34: type mismatch;"""))
18-
assert(res.err.contains(
19-
"""build.mill:9:5: value noSuchMethod is not a member"""
20-
))
14+
assert(!res.isSuccess)
15+
16+
locally {
17+
assert(res.err.contains("""bar.mill:15:9"""))
18+
assert(res.err.contains("""println(doesntExist)"""))
19+
assert(res.err.contains("""Not found: doesntExist"""))
20+
}
21+
22+
locally {
23+
assert(res.err.contains("""qux.mill:4:34"""))
24+
assert(res.err.contains("""myMsg.substring("0")"""))
25+
assert(res.err.contains("""Found: ("0" : String)"""))
26+
assert(res.err.contains("""Required: Int"""))
27+
}
28+
29+
locally {
30+
assert(res.err.contains("""build.mill:9:5"""))
31+
assert(res.err.contains("""foo.noSuchMethod"""))
32+
assert(res.err.contains("""value noSuchMethod is not a member"""))
33+
}
2134
}
2235
}
2336
}

scalalib/src/mill/scalalib/Assembly.scala

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,8 @@ object Assembly {
2121

2222
private object Streamable {
2323
def bytes(is: InputStream): Array[Byte] = {
24-
val buffer = new Array[Byte](8192)
2524
val out = new java.io.ByteArrayOutputStream
26-
var read = 0
27-
while ({
28-
read = is.read(buffer)
29-
read != -1
30-
}) {
31-
out.write(buffer, 0, read)
32-
}
25+
IO.stream(is, out)
3326
out.close()
3427
out.toByteArray
3528
}

0 commit comments

Comments
 (0)