Commit aae74ae 1 parent 594b695 commit aae74ae Copy full SHA for aae74ae
File tree 2 files changed +10
-3
lines changed
scala/munit/internal/console
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,12 @@ import scala.quoted._
6
6
import scala .language .experimental .macros
7
7
8
8
object MacroCompat {
9
- private val workingDirectory : String =
10
- sys.props(" user.dir" ) + java.io.File .separator
9
+ private val workingDirectory : String = {
10
+ val sep = java.io.File .separator
11
+ val cwd = sys.props(" user.dir" )
12
+ if (cwd.endsWith(sep)) cwd
13
+ else cwd + sep
14
+ }
11
15
12
16
trait LocationMacro {
13
17
inline implicit def generate : Location = $ { locationImpl() }
Original file line number Diff line number Diff line change @@ -23,7 +23,10 @@ class Lines extends Serializable {
23
23
val somePath1 =
24
24
if (somePath.endsWith(sep)) somePath.dropRight(sep.length)
25
25
else somePath
26
- somePath1.split(sep).dropRight(1 ).mkString(sep)
26
+ val sep1 =
27
+ if (sep == " \\ " ) " \\\\ "
28
+ else sep
29
+ somePath1.split(sep1).dropRight(1 ).mkString(sep)
27
30
}
28
31
if (Files .exists(p)) p
29
32
else if (max < 1 ) sys.error(s " $path was not found " )
You can’t perform that action at this time.
0 commit comments