mirror of
https://github.com/ij-plugins/ijp-imagej-launcher.git
synced 2024-11-13 16:29:01 -08:00
Add test for Scala Native #3293 that should be resolved in v.0.4.13
This commit is contained in:
parent
47674de560
commit
c30b853f64
2 changed files with 33 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
scalaVersion := "3.3.0"
|
scalaVersion := "3.3.0"
|
||||||
//name := "IJP-ImageJ-Launcher"
|
//name := "IJP-ImageJ-Launcher"
|
||||||
version := "0.1.1-SNAPSHOT"
|
version := "0.1.1-SNAPSHOT"
|
||||||
versionScheme := Some("early-semver")
|
versionScheme := Some("early-semver")
|
||||||
|
|
@ -16,14 +16,15 @@ enablePlugins(ScalaNativePlugin)
|
||||||
logLevel := Level.Info
|
logLevel := Level.Info
|
||||||
|
|
||||||
libraryDependencies ++= Seq(
|
libraryDependencies ++= Seq(
|
||||||
"com.github.scopt" %%% "scopt" % "4.1.0",
|
"com.github.scopt" %%% "scopt" % "4.1.0",
|
||||||
"com.lihaoyi" %%% "os-lib" % "0.9.1"
|
"com.lihaoyi" %%% "os-lib" % "0.9.1",
|
||||||
|
"org.scalatest" %%% "scalatest" % "3.2.16" % Test
|
||||||
)
|
)
|
||||||
|
|
||||||
Compile / run / mainClass := Some("ij_plugins.imagej_launcher.Main")
|
Compile / run / mainClass := Some("ij_plugins.imagej_launcher.Main")
|
||||||
|
|
||||||
// import to add Scala Native options
|
// import to add Scala Native options
|
||||||
import scala.scalanative.build._
|
import scala.scalanative.build.*
|
||||||
|
|
||||||
// defaults set with common options shown
|
// defaults set with common options shown
|
||||||
nativeConfig ~= { c =>
|
nativeConfig ~= { c =>
|
||||||
|
|
|
||||||
28
src/test/scala/ij_plugins/imagej_launcher/PathSpec.scala
Normal file
28
src/test/scala/ij_plugins/imagej_launcher/PathSpec.scala
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2000-2023 Jarek Sacha. All Rights Reserved.
|
||||||
|
* Author's e-mail: jpsacha at gmail.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
package ij_plugins.imagej_launcher
|
||||||
|
|
||||||
|
import org.scalatest.flatspec.AnyFlatSpec
|
||||||
|
import org.scalatest.matchers.should
|
||||||
|
|
||||||
|
import java.nio.file.FileSystems
|
||||||
|
import scala.scalanative.runtime.Platform.isWindows
|
||||||
|
|
||||||
|
class PathSpec extends AnyFlatSpec with should.Matchers:
|
||||||
|
|
||||||
|
"A Path" should "should `relativize` jars on Windows (Scala Native #3293)" in {
|
||||||
|
if isWindows() then
|
||||||
|
// This to test that fix for Scala Native #3293 implemented, it should be part of Scala Native 0.4.13
|
||||||
|
// See https://github.com/scala-native/scala-native/issues/3293
|
||||||
|
|
||||||
|
// val src = Path.of("C:\\a\\b\\c.jar")
|
||||||
|
val src = FileSystems.getDefault.getPath("C:\\a\\b\\c.jar")
|
||||||
|
// val base = Path.of("C:\\a")
|
||||||
|
val base = FileSystems.getDefault.getPath("C:\\a")
|
||||||
|
|
||||||
|
val rel = base.relativize(src)
|
||||||
|
rel.toString should be("b\\c.jar")
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue