Skip to content

Commit 2a3e247

Browse files
committed
Add regression test for rendering explain message
1 parent 5a50e50 commit 2a3e247

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed
Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
11
package scala.cli.integration
22

3-
class CompileTestsDefault extends CompileTestDefinitions(scalaVersionOpt = None)
3+
import com.eed3si9n.expecty.Expecty.expect
4+
class CompileTestsDefault extends CompileTestDefinitions(scalaVersionOpt = None) {
5+
test("render explain message") {
6+
val fileName = "Hello.scala"
7+
val inputs = TestInputs(
8+
os.rel / fileName -> // should be dump to 3.3.1 after release
9+
s"""//> using scala "3.3.1-RC1-bin-20230203-3ef1e73-NIGHTLY"
10+
|//> using options "--explain"
11+
|
12+
|class A
13+
|val i: Int = A()
14+
|""".stripMargin
15+
)
16+
inputs.fromRoot { root =>
17+
val out = os.proc(TestUtil.cli, "compile", extraOptions, fileName)
18+
.call(cwd = root, check = false, mergeErrIntoOut = true).out.trim()
19+
20+
expect(out.contains("Explanation"))
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)