mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-05 22:55:58 +00:00
Convert unit tests to munit
This commit is contained in:
parent
8ff83656ce
commit
6a63694a3e
38
build.sbt
38
build.sbt
@ -45,12 +45,6 @@ val sharedSettings = Seq(
|
|||||||
(scalacOptions.value.filter(o => !o.contains("-Xlint") && !o.contains("-W")))
|
(scalacOptions.value.filter(o => !o.contains("-Xlint") && !o.contains("-W")))
|
||||||
) ++ scalafixSettings
|
) ++ scalafixSettings
|
||||||
|
|
||||||
val testSettings = Seq(
|
|
||||||
testFrameworks += new TestFramework("minitest.runner.Framework"),
|
|
||||||
libraryDependencies ++= Dependencies.miniTest ++ Dependencies.logging.map(_ % Test),
|
|
||||||
Test / fork := true
|
|
||||||
)
|
|
||||||
|
|
||||||
val testSettingsMUnit = Seq(
|
val testSettingsMUnit = Seq(
|
||||||
libraryDependencies ++= Dependencies.munit.map(_ % Test),
|
libraryDependencies ++= Dependencies.munit.map(_ % Test),
|
||||||
testFrameworks += new TestFramework("munit.Framework")
|
testFrameworks += new TestFramework("munit.Framework")
|
||||||
@ -231,7 +225,7 @@ val common = project
|
|||||||
.in(file("modules/common"))
|
.in(file("modules/common"))
|
||||||
.disablePlugins(RevolverPlugin)
|
.disablePlugins(RevolverPlugin)
|
||||||
.settings(sharedSettings)
|
.settings(sharedSettings)
|
||||||
.settings(testSettings)
|
.settings(testSettingsMUnit)
|
||||||
.settings(
|
.settings(
|
||||||
name := "docspell-common",
|
name := "docspell-common",
|
||||||
libraryDependencies ++=
|
libraryDependencies ++=
|
||||||
@ -249,7 +243,7 @@ val files = project
|
|||||||
.in(file("modules/files"))
|
.in(file("modules/files"))
|
||||||
.disablePlugins(RevolverPlugin)
|
.disablePlugins(RevolverPlugin)
|
||||||
.settings(sharedSettings)
|
.settings(sharedSettings)
|
||||||
.settings(testSettings)
|
.settings(testSettingsMUnit)
|
||||||
.settings(
|
.settings(
|
||||||
name := "docspell-files",
|
name := "docspell-files",
|
||||||
libraryDependencies ++=
|
libraryDependencies ++=
|
||||||
@ -308,7 +302,7 @@ val store = project
|
|||||||
.in(file("modules/store"))
|
.in(file("modules/store"))
|
||||||
.disablePlugins(RevolverPlugin)
|
.disablePlugins(RevolverPlugin)
|
||||||
.settings(sharedSettings)
|
.settings(sharedSettings)
|
||||||
.settings(testSettings)
|
.settings(testSettingsMUnit)
|
||||||
.settings(
|
.settings(
|
||||||
name := "docspell-store",
|
name := "docspell-store",
|
||||||
libraryDependencies ++=
|
libraryDependencies ++=
|
||||||
@ -330,7 +324,7 @@ val extract = project
|
|||||||
.in(file("modules/extract"))
|
.in(file("modules/extract"))
|
||||||
.disablePlugins(RevolverPlugin)
|
.disablePlugins(RevolverPlugin)
|
||||||
.settings(sharedSettings)
|
.settings(sharedSettings)
|
||||||
.settings(testSettings)
|
.settings(testSettingsMUnit)
|
||||||
.settings(
|
.settings(
|
||||||
name := "docspell-extract",
|
name := "docspell-extract",
|
||||||
libraryDependencies ++=
|
libraryDependencies ++=
|
||||||
@ -347,7 +341,7 @@ val convert = project
|
|||||||
.in(file("modules/convert"))
|
.in(file("modules/convert"))
|
||||||
.disablePlugins(RevolverPlugin)
|
.disablePlugins(RevolverPlugin)
|
||||||
.settings(sharedSettings)
|
.settings(sharedSettings)
|
||||||
.settings(testSettings)
|
.settings(testSettingsMUnit)
|
||||||
.settings(
|
.settings(
|
||||||
name := "docspell-convert",
|
name := "docspell-convert",
|
||||||
libraryDependencies ++=
|
libraryDependencies ++=
|
||||||
@ -361,7 +355,7 @@ val analysis = project
|
|||||||
.disablePlugins(RevolverPlugin)
|
.disablePlugins(RevolverPlugin)
|
||||||
.enablePlugins(NerModelsPlugin)
|
.enablePlugins(NerModelsPlugin)
|
||||||
.settings(sharedSettings)
|
.settings(sharedSettings)
|
||||||
.settings(testSettings)
|
.settings(testSettingsMUnit)
|
||||||
.settings(NerModelsPlugin.nerClassifierSettings)
|
.settings(NerModelsPlugin.nerClassifierSettings)
|
||||||
.settings(
|
.settings(
|
||||||
name := "docspell-analysis",
|
name := "docspell-analysis",
|
||||||
@ -375,7 +369,7 @@ val ftsclient = project
|
|||||||
.in(file("modules/fts-client"))
|
.in(file("modules/fts-client"))
|
||||||
.disablePlugins(RevolverPlugin)
|
.disablePlugins(RevolverPlugin)
|
||||||
.settings(sharedSettings)
|
.settings(sharedSettings)
|
||||||
.settings(testSettings)
|
.settings(testSettingsMUnit)
|
||||||
.settings(
|
.settings(
|
||||||
name := "docspell-fts-client",
|
name := "docspell-fts-client",
|
||||||
libraryDependencies ++= Seq.empty
|
libraryDependencies ++= Seq.empty
|
||||||
@ -386,7 +380,7 @@ val ftssolr = project
|
|||||||
.in(file("modules/fts-solr"))
|
.in(file("modules/fts-solr"))
|
||||||
.disablePlugins(RevolverPlugin)
|
.disablePlugins(RevolverPlugin)
|
||||||
.settings(sharedSettings)
|
.settings(sharedSettings)
|
||||||
.settings(testSettings)
|
.settings(testSettingsMUnit)
|
||||||
.settings(
|
.settings(
|
||||||
name := "docspell-fts-solr",
|
name := "docspell-fts-solr",
|
||||||
libraryDependencies ++=
|
libraryDependencies ++=
|
||||||
@ -402,7 +396,7 @@ val restapi = project
|
|||||||
.disablePlugins(RevolverPlugin)
|
.disablePlugins(RevolverPlugin)
|
||||||
.enablePlugins(OpenApiSchema)
|
.enablePlugins(OpenApiSchema)
|
||||||
.settings(sharedSettings)
|
.settings(sharedSettings)
|
||||||
.settings(testSettings)
|
.settings(testSettingsMUnit)
|
||||||
.settings(openapiScalaSettings)
|
.settings(openapiScalaSettings)
|
||||||
.settings(
|
.settings(
|
||||||
name := "docspell-restapi",
|
name := "docspell-restapi",
|
||||||
@ -420,7 +414,7 @@ val joexapi = project
|
|||||||
.disablePlugins(RevolverPlugin)
|
.disablePlugins(RevolverPlugin)
|
||||||
.enablePlugins(OpenApiSchema)
|
.enablePlugins(OpenApiSchema)
|
||||||
.settings(sharedSettings)
|
.settings(sharedSettings)
|
||||||
.settings(testSettings)
|
.settings(testSettingsMUnit)
|
||||||
.settings(openapiScalaSettings)
|
.settings(openapiScalaSettings)
|
||||||
.settings(
|
.settings(
|
||||||
name := "docspell-joexapi",
|
name := "docspell-joexapi",
|
||||||
@ -438,7 +432,7 @@ val backend = project
|
|||||||
.in(file("modules/backend"))
|
.in(file("modules/backend"))
|
||||||
.disablePlugins(RevolverPlugin)
|
.disablePlugins(RevolverPlugin)
|
||||||
.settings(sharedSettings)
|
.settings(sharedSettings)
|
||||||
.settings(testSettings)
|
.settings(testSettingsMUnit)
|
||||||
.settings(
|
.settings(
|
||||||
name := "docspell-backend",
|
name := "docspell-backend",
|
||||||
libraryDependencies ++=
|
libraryDependencies ++=
|
||||||
@ -473,7 +467,7 @@ val joex = project
|
|||||||
.in(file("modules/joex"))
|
.in(file("modules/joex"))
|
||||||
.enablePlugins(BuildInfoPlugin, JavaServerAppPackaging, DebianPlugin, SystemdPlugin)
|
.enablePlugins(BuildInfoPlugin, JavaServerAppPackaging, DebianPlugin, SystemdPlugin)
|
||||||
.settings(sharedSettings)
|
.settings(sharedSettings)
|
||||||
.settings(testSettings)
|
.settings(testSettingsMUnit)
|
||||||
.settings(debianSettings("docspell-joex"))
|
.settings(debianSettings("docspell-joex"))
|
||||||
.settings(buildInfoSettings)
|
.settings(buildInfoSettings)
|
||||||
.settings(
|
.settings(
|
||||||
@ -512,7 +506,7 @@ val restserver = project
|
|||||||
.in(file("modules/restserver"))
|
.in(file("modules/restserver"))
|
||||||
.enablePlugins(BuildInfoPlugin, JavaServerAppPackaging, DebianPlugin, SystemdPlugin)
|
.enablePlugins(BuildInfoPlugin, JavaServerAppPackaging, DebianPlugin, SystemdPlugin)
|
||||||
.settings(sharedSettings)
|
.settings(sharedSettings)
|
||||||
.settings(testSettings)
|
.settings(testSettingsMUnit)
|
||||||
.settings(debianSettings("docspell-server"))
|
.settings(debianSettings("docspell-server"))
|
||||||
.settings(buildInfoSettings)
|
.settings(buildInfoSettings)
|
||||||
.settings(
|
.settings(
|
||||||
@ -740,7 +734,8 @@ def packageTools(logger: Logger, dir: File, version: String): Seq[File] = {
|
|||||||
wx / "icons" / "logo-96.png" -> "icons/logo-96.png",
|
wx / "icons" / "logo-96.png" -> "icons/logo-96.png",
|
||||||
wx / "manifest.json" -> "manifest.json"
|
wx / "manifest.json" -> "manifest.json"
|
||||||
),
|
),
|
||||||
webext
|
webext,
|
||||||
|
None
|
||||||
)
|
)
|
||||||
|
|
||||||
val excludes = Seq(wx, target)
|
val excludes = Seq(wx, target)
|
||||||
@ -757,7 +752,8 @@ def packageTools(logger: Logger, dir: File, version: String): Seq[File] = {
|
|||||||
wx / "native/app_manifest.json" -> s"docspell-tools-${version}/firefox/native/app_manifest.json",
|
wx / "native/app_manifest.json" -> s"docspell-tools-${version}/firefox/native/app_manifest.json",
|
||||||
wx / "native/native.py" -> s"docspell-tools-${version}/firefox/native/native.py"
|
wx / "native/native.py" -> s"docspell-tools-${version}/firefox/native/native.py"
|
||||||
) ++ files,
|
) ++ files,
|
||||||
archive
|
archive,
|
||||||
|
None
|
||||||
)
|
)
|
||||||
|
|
||||||
Seq(archive)
|
Seq(archive)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package docspell.analysis.classifier
|
package docspell.analysis.classifier
|
||||||
|
|
||||||
import minitest._
|
import munit._
|
||||||
import cats.effect._
|
import cats.effect._
|
||||||
import scala.concurrent.ExecutionContext
|
import scala.concurrent.ExecutionContext
|
||||||
import java.nio.file.Paths
|
import java.nio.file.Paths
|
||||||
@ -10,7 +10,7 @@ import fs2.Stream
|
|||||||
import cats.data.Kleisli
|
import cats.data.Kleisli
|
||||||
import TextClassifier.Data
|
import TextClassifier.Data
|
||||||
|
|
||||||
object StanfordTextClassifierSuite extends SimpleTestSuite {
|
class StanfordTextClassifierSuite extends FunSuite {
|
||||||
val logger = Logger.log4s[IO](org.log4s.getLogger)
|
val logger = Logger.log4s[IO](org.log4s.getLogger)
|
||||||
|
|
||||||
implicit val CS = IO.contextShift(ExecutionContext.global)
|
implicit val CS = IO.contextShift(ExecutionContext.global)
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package docspell.analysis.contact
|
package docspell.analysis.contact
|
||||||
|
|
||||||
import docspell.common.{NerLabel, NerTag}
|
import docspell.common.{NerLabel, NerTag}
|
||||||
import minitest.SimpleTestSuite
|
import munit._
|
||||||
|
|
||||||
object ContactAnnotateSpec extends SimpleTestSuite {
|
class ContactAnnotateSpec extends FunSuite {
|
||||||
|
|
||||||
test("find email") {
|
test("find email") {
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package docspell.analysis.date
|
package docspell.analysis.date
|
||||||
|
|
||||||
import docspell.files.TestFiles
|
import docspell.files.TestFiles
|
||||||
import minitest.SimpleTestSuite
|
import munit._
|
||||||
import docspell.common._
|
import docspell.common._
|
||||||
import java.time._
|
import java.time._
|
||||||
|
|
||||||
object DateFindSpec extends SimpleTestSuite {
|
class DateFindSpec extends FunSuite {
|
||||||
|
|
||||||
test("find simple dates") {
|
test("find simple dates") {
|
||||||
val expect = Vector(
|
val expect = Vector(
|
||||||
|
@ -2,19 +2,17 @@ package docspell.analysis.nlp
|
|||||||
|
|
||||||
import docspell.analysis.Env
|
import docspell.analysis.Env
|
||||||
import docspell.common.Language.NLPLanguage
|
import docspell.common.Language.NLPLanguage
|
||||||
import minitest.SimpleTestSuite
|
import munit._
|
||||||
import docspell.files.TestFiles
|
import docspell.files.TestFiles
|
||||||
import docspell.common._
|
import docspell.common._
|
||||||
|
|
||||||
object BaseCRFAnnotatorSuite extends SimpleTestSuite {
|
class BaseCRFAnnotatorSuite extends FunSuite {
|
||||||
|
|
||||||
def annotate(language: NLPLanguage): String => Vector[NerLabel] =
|
def annotate(language: NLPLanguage): String => Vector[NerLabel] =
|
||||||
BasicCRFAnnotator.nerAnnotate(BasicCRFAnnotator.Cache.getAnnotator(language))
|
BasicCRFAnnotator.nerAnnotate(BasicCRFAnnotator.Cache.getAnnotator(language))
|
||||||
|
|
||||||
test("find english ner labels") {
|
test("find english ner labels") {
|
||||||
if (Env.isCI) {
|
assume(!Env.isCI, "Test ignored on travis.")
|
||||||
ignore("Test ignored on travis.")
|
|
||||||
}
|
|
||||||
|
|
||||||
val labels = annotate(Language.English)(TestFiles.letterENText)
|
val labels = annotate(Language.English)(TestFiles.letterENText)
|
||||||
val expect = Vector(
|
val expect = Vector(
|
||||||
@ -52,9 +50,7 @@ object BaseCRFAnnotatorSuite extends SimpleTestSuite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test("find german ner labels") {
|
test("find german ner labels") {
|
||||||
if (Env.isCI) {
|
assume(!Env.isCI, "Test ignored on travis.")
|
||||||
ignore("Test ignored on travis.")
|
|
||||||
}
|
|
||||||
|
|
||||||
val labels = annotate(Language.German)(TestFiles.letterDEText)
|
val labels = annotate(Language.German)(TestFiles.letterDEText)
|
||||||
val expect = Vector(
|
val expect = Vector(
|
||||||
|
@ -4,22 +4,20 @@ import java.nio.file.Paths
|
|||||||
|
|
||||||
import cats.effect.IO
|
import cats.effect.IO
|
||||||
import docspell.analysis.Env
|
import docspell.analysis.Env
|
||||||
import minitest.SimpleTestSuite
|
import munit._
|
||||||
import docspell.files.TestFiles
|
import docspell.files.TestFiles
|
||||||
import docspell.common._
|
import docspell.common._
|
||||||
import docspell.common.syntax.FileSyntax._
|
import docspell.common.syntax.FileSyntax._
|
||||||
import edu.stanford.nlp.pipeline.StanfordCoreNLP
|
import edu.stanford.nlp.pipeline.StanfordCoreNLP
|
||||||
|
|
||||||
object StanfordNerAnnotatorSuite extends SimpleTestSuite {
|
class StanfordNerAnnotatorSuite extends FunSuite {
|
||||||
lazy val germanClassifier =
|
lazy val germanClassifier =
|
||||||
new StanfordCoreNLP(Properties.nerGerman(None, false))
|
new StanfordCoreNLP(Properties.nerGerman(None, false))
|
||||||
lazy val englishClassifier =
|
lazy val englishClassifier =
|
||||||
new StanfordCoreNLP(Properties.nerEnglish(None))
|
new StanfordCoreNLP(Properties.nerEnglish(None))
|
||||||
|
|
||||||
test("find english ner labels") {
|
test("find english ner labels") {
|
||||||
if (Env.isCI) {
|
assume(!Env.isCI, "Test ignored on travis.")
|
||||||
ignore("Test ignored on travis.")
|
|
||||||
}
|
|
||||||
|
|
||||||
val labels =
|
val labels =
|
||||||
StanfordNerAnnotator.nerAnnotate(englishClassifier, TestFiles.letterENText)
|
StanfordNerAnnotator.nerAnnotate(englishClassifier, TestFiles.letterENText)
|
||||||
@ -58,9 +56,7 @@ object StanfordNerAnnotatorSuite extends SimpleTestSuite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test("find german ner labels") {
|
test("find german ner labels") {
|
||||||
if (Env.isCI) {
|
assume(!Env.isCI, "Test ignored on travis.")
|
||||||
ignore("Test ignored on travis.")
|
|
||||||
}
|
|
||||||
|
|
||||||
val labels =
|
val labels =
|
||||||
StanfordNerAnnotator.nerAnnotate(germanClassifier, TestFiles.letterDEText)
|
StanfordNerAnnotator.nerAnnotate(germanClassifier, TestFiles.letterDEText)
|
||||||
@ -83,9 +79,7 @@ object StanfordNerAnnotatorSuite extends SimpleTestSuite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test("regexner-only annotator") {
|
test("regexner-only annotator") {
|
||||||
if (Env.isCI) {
|
assume(!Env.isCI, "Test ignored on travis.")
|
||||||
ignore("Test ignored on travis.")
|
|
||||||
}
|
|
||||||
|
|
||||||
val regexNerContent =
|
val regexNerContent =
|
||||||
s"""(?i)volantino ag${"\t"}ORGANIZATION${"\t"}LOCATION,PERSON,MISC${"\t"}3
|
s"""(?i)volantino ag${"\t"}ORGANIZATION${"\t"}LOCATION,PERSON,MISC${"\t"}3
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package docspell.analysis.split
|
package docspell.analysis.split
|
||||||
|
|
||||||
import minitest.SimpleTestSuite
|
import munit._
|
||||||
|
|
||||||
object TestSplitterSpec extends SimpleTestSuite {
|
class TestSplitterSpec extends FunSuite {
|
||||||
|
|
||||||
test("simple splitting") {
|
test("simple splitting") {
|
||||||
val text = """hiermit kündige ich meine Mitgliedschaft in der Kranken- und
|
val text = """hiermit kündige ich meine Mitgliedschaft in der Kranken- und
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package docspell.common
|
package docspell.common
|
||||||
|
|
||||||
import minitest._
|
import munit._
|
||||||
|
|
||||||
object FileNameTest extends SimpleTestSuite {
|
class FileNameTest extends FunSuite {
|
||||||
|
|
||||||
test("make filename") {
|
test("make filename") {
|
||||||
val data = List(
|
val data = List(
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package docspell.common
|
package docspell.common
|
||||||
|
|
||||||
import minitest._
|
import munit._
|
||||||
import Glob._
|
import Glob._
|
||||||
|
|
||||||
object GlobTest extends SimpleTestSuite {
|
class GlobTest extends FunSuite {
|
||||||
|
|
||||||
test("literals") {
|
test("literals") {
|
||||||
assert(Glob.pattern(Pattern(Segment(Token.Literal("hello")))).matches(true)("hello"))
|
assert(Glob.pattern(Pattern(Segment(Token.Literal("hello")))).matches(true)("hello"))
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package docspell.common
|
package docspell.common
|
||||||
|
|
||||||
import minitest._
|
import munit._
|
||||||
import cats.data.NonEmptyList
|
import cats.data.NonEmptyList
|
||||||
import docspell.common.MetaProposal.Candidate
|
import docspell.common.MetaProposal.Candidate
|
||||||
|
|
||||||
object MetaProposalListTest extends SimpleTestSuite {
|
class MetaProposalListTest extends FunSuite {
|
||||||
|
|
||||||
test("flatten retains order of candidates") {
|
test("flatten retains order of candidates") {
|
||||||
val cand1 = Candidate(IdRef(Ident.unsafe("123"), "name"), Set.empty)
|
val cand1 = Candidate(IdRef(Ident.unsafe("123"), "name"), Set.empty)
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package docspell.common
|
package docspell.common
|
||||||
|
|
||||||
import minitest._
|
import munit._
|
||||||
|
|
||||||
object NerLabelSpanTest extends SimpleTestSuite {
|
class NerLabelSpanTest extends FunSuite {
|
||||||
|
|
||||||
test("build") {
|
test("build") {
|
||||||
val labels = List(
|
val labels = List(
|
||||||
|
@ -11,10 +11,10 @@ import docspell.convert.ConversionResult.Handler
|
|||||||
import docspell.convert.extern.{TesseractConfig, UnoconvConfig, WkHtmlPdfConfig}
|
import docspell.convert.extern.{TesseractConfig, UnoconvConfig, WkHtmlPdfConfig}
|
||||||
import docspell.convert.flexmark.MarkdownConfig
|
import docspell.convert.flexmark.MarkdownConfig
|
||||||
import docspell.files.{ExampleFiles, TestFiles}
|
import docspell.files.{ExampleFiles, TestFiles}
|
||||||
import minitest.SimpleTestSuite
|
import munit._
|
||||||
import docspell.convert.extern.OcrMyPdfConfig
|
import docspell.convert.extern.OcrMyPdfConfig
|
||||||
|
|
||||||
object ConversionTest extends SimpleTestSuite with FileChecks {
|
class ConversionTest extends FunSuite with FileChecks {
|
||||||
val blocker = TestFiles.blocker
|
val blocker = TestFiles.blocker
|
||||||
implicit val CS = TestFiles.CS
|
implicit val CS = TestFiles.CS
|
||||||
|
|
||||||
@ -101,59 +101,58 @@ object ConversionTest extends SimpleTestSuite with FileChecks {
|
|||||||
)
|
)
|
||||||
|
|
||||||
test("convert to pdf") {
|
test("convert to pdf") {
|
||||||
if (!commandsExist) ignore("At least one of the conversion programs not found")
|
assume(commandsExist, "At least one of the conversion programs not found")
|
||||||
else
|
|
||||||
File
|
|
||||||
.withTempDir[IO](target, "convpdf")
|
|
||||||
.use { dir =>
|
|
||||||
conversion.use { conv =>
|
|
||||||
def check(n: Long): Handler[IO, Unit] =
|
|
||||||
storePdfHandler(dir.resolve(s"test-$n.pdf")).map { p =>
|
|
||||||
assert(p.isNonEmpty && p.isPDF)
|
|
||||||
}
|
|
||||||
|
|
||||||
runConversion(pdfOnly, check, conv).compile.drain
|
File
|
||||||
}
|
.withTempDir[IO](target, "convpdf")
|
||||||
|
.use { dir =>
|
||||||
|
conversion.use { conv =>
|
||||||
|
def check(n: Long): Handler[IO, Unit] =
|
||||||
|
storePdfHandler(dir.resolve(s"test-$n.pdf")).map { p =>
|
||||||
|
assert(p.isNonEmpty && p.isPDF)
|
||||||
|
}
|
||||||
|
|
||||||
|
runConversion(pdfOnly, check, conv).compile.drain
|
||||||
}
|
}
|
||||||
.unsafeRunSync()
|
}
|
||||||
|
.unsafeRunSync()
|
||||||
}
|
}
|
||||||
|
|
||||||
test("convert image to pdf and txt") {
|
test("convert image to pdf and txt") {
|
||||||
if (!commandsExist) ignore("At least one of the conversion programs not found")
|
assume(commandsExist, "At least one of the conversion programs not found")
|
||||||
else
|
File
|
||||||
File
|
.withTempDir[IO](target, "convimgpdf")
|
||||||
.withTempDir[IO](target, "convimgpdf")
|
.use { dir =>
|
||||||
.use { dir =>
|
conversion.use { conv =>
|
||||||
conversion.use { conv =>
|
def check(n: Long): Handler[IO, Unit] =
|
||||||
def check(n: Long): Handler[IO, Unit] =
|
storePdfTxtHandler(dir.resolve(s"test-$n.pdf"), dir.resolve(s"test-$n.txt"))
|
||||||
storePdfTxtHandler(dir.resolve(s"test-$n.pdf"), dir.resolve(s"test-$n.txt"))
|
.map { case (p, t) =>
|
||||||
.map { case (p, t) =>
|
assert(p.isNonEmpty && p.isPDF)
|
||||||
assert(p.isNonEmpty && p.isPDF)
|
assert(t.isNonEmpty && t.isPlainText)
|
||||||
assert(t.isNonEmpty && t.isPlainText)
|
}
|
||||||
}
|
|
||||||
|
|
||||||
runConversion(pdfAndTxt, check, conv).compile.drain
|
runConversion(pdfAndTxt, check, conv).compile.drain
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.unsafeRunSync()
|
}
|
||||||
|
.unsafeRunSync()
|
||||||
}
|
}
|
||||||
|
|
||||||
test("do not convert image bombs") {
|
test("do not convert image bombs") {
|
||||||
if (!commandsExist) ignore("At least one of the conversion programs not found")
|
assume(commandsExist, "At least one of the conversion programs not found")
|
||||||
else
|
|
||||||
conversion
|
|
||||||
.use { conv =>
|
|
||||||
def check: Handler[IO, Unit] =
|
|
||||||
Kleisli({
|
|
||||||
case ConversionResult.InputMalformed(_, _) =>
|
|
||||||
().pure[IO]
|
|
||||||
case cr =>
|
|
||||||
IO.raiseError(new Exception(s"Unexpected result: $cr"))
|
|
||||||
})
|
|
||||||
|
|
||||||
runConversion(bombs, _ => check, conv).compile.drain
|
conversion
|
||||||
}
|
.use { conv =>
|
||||||
.unsafeRunSync()
|
def check: Handler[IO, Unit] =
|
||||||
|
Kleisli({
|
||||||
|
case ConversionResult.InputMalformed(_, _) =>
|
||||||
|
().pure[IO]
|
||||||
|
case cr =>
|
||||||
|
IO.raiseError(new Exception(s"Unexpected result: $cr"))
|
||||||
|
})
|
||||||
|
|
||||||
|
runConversion(bombs, _ => check, conv).compile.drain
|
||||||
|
}
|
||||||
|
.unsafeRunSync()
|
||||||
}
|
}
|
||||||
|
|
||||||
def runConversion[A](
|
def runConversion[A](
|
||||||
|
@ -6,10 +6,10 @@ import cats.effect._
|
|||||||
import docspell.common._
|
import docspell.common._
|
||||||
import docspell.convert._
|
import docspell.convert._
|
||||||
import docspell.files.{ExampleFiles, TestFiles}
|
import docspell.files.{ExampleFiles, TestFiles}
|
||||||
import minitest.SimpleTestSuite
|
import munit._
|
||||||
import java.nio.charset.StandardCharsets
|
import java.nio.charset.StandardCharsets
|
||||||
|
|
||||||
object ExternConvTest extends SimpleTestSuite with FileChecks {
|
class ExternConvTest extends FunSuite with FileChecks {
|
||||||
val blocker = TestFiles.blocker
|
val blocker = TestFiles.blocker
|
||||||
implicit val CS = TestFiles.CS
|
implicit val CS = TestFiles.CS
|
||||||
val utf8 = StandardCharsets.UTF_8
|
val utf8 = StandardCharsets.UTF_8
|
||||||
@ -22,26 +22,24 @@ object ExternConvTest extends SimpleTestSuite with FileChecks {
|
|||||||
Seq("-s", "A4", "--encoding", "UTF-8", "-", "{{outfile}}"),
|
Seq("-s", "A4", "--encoding", "UTF-8", "-", "{{outfile}}"),
|
||||||
Duration.seconds(20)
|
Duration.seconds(20)
|
||||||
)
|
)
|
||||||
|
assume(commandExists(cfg.program), s"Command ${cfg.program} not found. Ignore tests.")
|
||||||
|
File
|
||||||
|
.withTempDir[IO](target, "wkhtmltopdf")
|
||||||
|
.use(dir =>
|
||||||
|
IO {
|
||||||
|
val wkCfg = WkHtmlPdfConfig(cfg, target)
|
||||||
|
val p =
|
||||||
|
WkHtmlPdf
|
||||||
|
.toPDF[IO, Path](wkCfg, 8192, utf8, SanitizeHtml.none, blocker, logger)(
|
||||||
|
ExampleFiles.letter_de_html.readURL[IO](8192, blocker),
|
||||||
|
storePdfHandler(dir.resolve("test.pdf"))
|
||||||
|
)
|
||||||
|
.unsafeRunSync()
|
||||||
|
|
||||||
if (!commandExists(cfg.program)) ignore(s"Command ${cfg.program} not found")
|
assert(p.isNonEmpty && p.isPDF)
|
||||||
else
|
}
|
||||||
File
|
)
|
||||||
.withTempDir[IO](target, "wkhtmltopdf")
|
.unsafeRunSync()
|
||||||
.use(dir =>
|
|
||||||
IO {
|
|
||||||
val wkCfg = WkHtmlPdfConfig(cfg, target)
|
|
||||||
val p =
|
|
||||||
WkHtmlPdf
|
|
||||||
.toPDF[IO, Path](wkCfg, 8192, utf8, SanitizeHtml.none, blocker, logger)(
|
|
||||||
ExampleFiles.letter_de_html.readURL[IO](8192, blocker),
|
|
||||||
storePdfHandler(dir.resolve("test.pdf"))
|
|
||||||
)
|
|
||||||
.unsafeRunSync()
|
|
||||||
|
|
||||||
assert(p.isNonEmpty && p.isPDF)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.unsafeRunSync()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
test("convert office to pdf") {
|
test("convert office to pdf") {
|
||||||
@ -51,25 +49,24 @@ object ExternConvTest extends SimpleTestSuite with FileChecks {
|
|||||||
Duration.seconds(20)
|
Duration.seconds(20)
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!commandExists(cfg.program)) ignore(s"Command ${cfg.program} not found")
|
assume(commandExists(cfg.program), s"Command ${cfg.program} not found. Ignore tests.")
|
||||||
else
|
File
|
||||||
File
|
.withTempDir[IO](target, "unoconv")
|
||||||
.withTempDir[IO](target, "unoconv")
|
.use(dir =>
|
||||||
.use(dir =>
|
IO {
|
||||||
IO {
|
val ucCfg = UnoconvConfig(cfg, target)
|
||||||
val ucCfg = UnoconvConfig(cfg, target)
|
val p =
|
||||||
val p =
|
Unoconv
|
||||||
Unoconv
|
.toPDF[IO, Path](ucCfg, 8192, blocker, logger)(
|
||||||
.toPDF[IO, Path](ucCfg, 8192, blocker, logger)(
|
ExampleFiles.examples_sample_docx.readURL[IO](8192, blocker),
|
||||||
ExampleFiles.examples_sample_docx.readURL[IO](8192, blocker),
|
storePdfHandler(dir.resolve("test.pdf"))
|
||||||
storePdfHandler(dir.resolve("test.pdf"))
|
)
|
||||||
)
|
.unsafeRunSync()
|
||||||
.unsafeRunSync()
|
|
||||||
|
|
||||||
assert(p.isNonEmpty && p.isPDF)
|
assert(p.isNonEmpty && p.isPDF)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.unsafeRunSync()
|
.unsafeRunSync()
|
||||||
}
|
}
|
||||||
|
|
||||||
test("convert image to pdf") {
|
test("convert image to pdf") {
|
||||||
@ -78,27 +75,25 @@ object ExternConvTest extends SimpleTestSuite with FileChecks {
|
|||||||
Seq("{{infile}}", "out", "-l", "deu", "pdf", "txt"),
|
Seq("{{infile}}", "out", "-l", "deu", "pdf", "txt"),
|
||||||
Duration.seconds(20)
|
Duration.seconds(20)
|
||||||
)
|
)
|
||||||
|
assume(commandExists(cfg.program), s"Command ${cfg.program} not found")
|
||||||
|
File
|
||||||
|
.withTempDir[IO](target, "tesseract")
|
||||||
|
.use(dir =>
|
||||||
|
IO {
|
||||||
|
val tessCfg = TesseractConfig(cfg, target)
|
||||||
|
val (pdf, txt) =
|
||||||
|
Tesseract
|
||||||
|
.toPDF[IO, (Path, Path)](tessCfg, Language.German, 8192, blocker, logger)(
|
||||||
|
ExampleFiles.camera_letter_en_jpg.readURL[IO](8192, blocker),
|
||||||
|
storePdfTxtHandler(dir.resolve("test.pdf"), dir.resolve("test.txt"))
|
||||||
|
)
|
||||||
|
.unsafeRunSync()
|
||||||
|
|
||||||
if (!commandExists(cfg.program)) ignore(s"Command ${cfg.program} not found")
|
assert(pdf.isNonEmpty && pdf.isPDF)
|
||||||
else
|
assert(txt.isNonEmpty && txt.isPlainText)
|
||||||
File
|
}
|
||||||
.withTempDir[IO](target, "tesseract")
|
)
|
||||||
.use(dir =>
|
.unsafeRunSync()
|
||||||
IO {
|
|
||||||
val tessCfg = TesseractConfig(cfg, target)
|
|
||||||
val (pdf, txt) =
|
|
||||||
Tesseract
|
|
||||||
.toPDF[IO, (Path, Path)](tessCfg, Language.German, 8192, blocker, logger)(
|
|
||||||
ExampleFiles.camera_letter_en_jpg.readURL[IO](8192, blocker),
|
|
||||||
storePdfTxtHandler(dir.resolve("test.pdf"), dir.resolve("test.txt"))
|
|
||||||
)
|
|
||||||
.unsafeRunSync()
|
|
||||||
|
|
||||||
assert(pdf.isNonEmpty && pdf.isPDF)
|
|
||||||
assert(txt.isNonEmpty && txt.isPlainText)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.unsafeRunSync()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,15 +3,14 @@ package docspell.extract.ocr
|
|||||||
import cats.effect.IO
|
import cats.effect.IO
|
||||||
import docspell.common.Logger
|
import docspell.common.Logger
|
||||||
import docspell.files.TestFiles
|
import docspell.files.TestFiles
|
||||||
import minitest.SimpleTestSuite
|
import munit._
|
||||||
|
|
||||||
object TextExtractionSuite extends SimpleTestSuite {
|
class TextExtractionSuite extends FunSuite {
|
||||||
import TestFiles._
|
import TestFiles._
|
||||||
|
|
||||||
val logger = Logger.log4s[IO](org.log4s.getLogger)
|
val logger = Logger.log4s[IO](org.log4s.getLogger)
|
||||||
|
|
||||||
test("extract english pdf") {
|
test("extract english pdf".ignore) {
|
||||||
ignore()
|
|
||||||
val text = TextExtract
|
val text = TextExtract
|
||||||
.extract[IO](letterSourceEN, blocker, logger, "eng", OcrConfig.default)
|
.extract[IO](letterSourceEN, blocker, logger, "eng", OcrConfig.default)
|
||||||
.compile
|
.compile
|
||||||
@ -20,8 +19,7 @@ object TextExtractionSuite extends SimpleTestSuite {
|
|||||||
println(text)
|
println(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
test("extract german pdf") {
|
test("extract german pdf".ignore) {
|
||||||
ignore()
|
|
||||||
val expect = TestFiles.letterDEText
|
val expect = TestFiles.letterDEText
|
||||||
val extract = TextExtract
|
val extract = TextExtract
|
||||||
.extract[IO](letterSourceDE, blocker, logger, "deu", OcrConfig.default)
|
.extract[IO](letterSourceDE, blocker, logger, "deu", OcrConfig.default)
|
||||||
|
@ -2,9 +2,9 @@ package docspell.extract.odf
|
|||||||
|
|
||||||
import cats.effect._
|
import cats.effect._
|
||||||
import docspell.files.{ExampleFiles, TestFiles}
|
import docspell.files.{ExampleFiles, TestFiles}
|
||||||
import minitest.SimpleTestSuite
|
import munit._
|
||||||
|
|
||||||
object OdfExtractTest extends SimpleTestSuite {
|
class OdfExtractTest extends FunSuite {
|
||||||
val blocker = TestFiles.blocker
|
val blocker = TestFiles.blocker
|
||||||
implicit val CS = TestFiles.CS
|
implicit val CS = TestFiles.CS
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package docspell.extract.pdfbox
|
package docspell.extract.pdfbox
|
||||||
|
|
||||||
import minitest.SimpleTestSuite
|
import munit._
|
||||||
|
|
||||||
object PdfMetaDataTest extends SimpleTestSuite {
|
class PdfMetaDataTest extends FunSuite {
|
||||||
|
|
||||||
test("split keywords on comma") {
|
test("split keywords on comma") {
|
||||||
val md = PdfMetaData.empty.copy(keywords = Some("a,b, c"))
|
val md = PdfMetaData.empty.copy(keywords = Some("a,b, c"))
|
||||||
|
@ -2,9 +2,9 @@ package docspell.extract.pdfbox
|
|||||||
|
|
||||||
import cats.effect._
|
import cats.effect._
|
||||||
import docspell.files.{ExampleFiles, TestFiles}
|
import docspell.files.{ExampleFiles, TestFiles}
|
||||||
import minitest.SimpleTestSuite
|
import munit._
|
||||||
|
|
||||||
object PdfboxExtractTest extends SimpleTestSuite {
|
class PdfboxExtractTest extends FunSuite {
|
||||||
val blocker = TestFiles.blocker
|
val blocker = TestFiles.blocker
|
||||||
implicit val CS = TestFiles.CS
|
implicit val CS = TestFiles.CS
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@ package docspell.extract.pdfbox
|
|||||||
|
|
||||||
import cats.effect._
|
import cats.effect._
|
||||||
import docspell.files.{ExampleFiles, TestFiles}
|
import docspell.files.{ExampleFiles, TestFiles}
|
||||||
import minitest.SimpleTestSuite
|
import munit._
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
import fs2.Stream
|
import fs2.Stream
|
||||||
|
|
||||||
object PdfboxPreviewTest extends SimpleTestSuite {
|
class PdfboxPreviewTest extends FunSuite {
|
||||||
val blocker = TestFiles.blocker
|
val blocker = TestFiles.blocker
|
||||||
implicit val CS = TestFiles.CS
|
implicit val CS = TestFiles.CS
|
||||||
|
|
||||||
|
@ -3,9 +3,9 @@ package docspell.extract.poi
|
|||||||
import cats.effect._
|
import cats.effect._
|
||||||
import docspell.common.MimeTypeHint
|
import docspell.common.MimeTypeHint
|
||||||
import docspell.files.{ExampleFiles, TestFiles}
|
import docspell.files.{ExampleFiles, TestFiles}
|
||||||
import minitest.SimpleTestSuite
|
import munit._
|
||||||
|
|
||||||
object PoiExtractTest extends SimpleTestSuite {
|
class PoiExtractTest extends FunSuite {
|
||||||
val blocker = TestFiles.blocker
|
val blocker = TestFiles.blocker
|
||||||
implicit val CS = TestFiles.CS
|
implicit val CS = TestFiles.CS
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package docspell.extract.rtf
|
package docspell.extract.rtf
|
||||||
|
|
||||||
import docspell.files.ExampleFiles
|
import docspell.files.ExampleFiles
|
||||||
import minitest.SimpleTestSuite
|
import munit._
|
||||||
|
|
||||||
object RtfExtractTest extends SimpleTestSuite {
|
class RtfExtractTest extends FunSuite {
|
||||||
|
|
||||||
test("extract text from rtf using java input-stream") {
|
test("extract text from rtf using java input-stream") {
|
||||||
val file = ExampleFiles.examples_sample_rtf
|
val file = ExampleFiles.examples_sample_rtf
|
||||||
|
@ -2,12 +2,12 @@ package docspell.files
|
|||||||
|
|
||||||
import cats.implicits._
|
import cats.implicits._
|
||||||
import cats.effect.{Blocker, IO}
|
import cats.effect.{Blocker, IO}
|
||||||
import minitest.SimpleTestSuite
|
import munit._
|
||||||
|
|
||||||
import scala.concurrent.ExecutionContext
|
import scala.concurrent.ExecutionContext
|
||||||
import scala.util.Using
|
import scala.util.Using
|
||||||
|
|
||||||
object ImageSizeTest extends SimpleTestSuite {
|
class ImageSizeTest extends FunSuite {
|
||||||
val blocker = Blocker.liftExecutionContext(ExecutionContext.global)
|
val blocker = Blocker.liftExecutionContext(ExecutionContext.global)
|
||||||
implicit val CS = IO.contextShift(ExecutionContext.global)
|
implicit val CS = IO.contextShift(ExecutionContext.global)
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package docspell.files
|
package docspell.files
|
||||||
|
|
||||||
import minitest._
|
import munit._
|
||||||
import cats.effect._
|
import cats.effect._
|
||||||
import cats.implicits._
|
import cats.implicits._
|
||||||
import scala.concurrent.ExecutionContext
|
import scala.concurrent.ExecutionContext
|
||||||
import docspell.common.Glob
|
import docspell.common.Glob
|
||||||
|
|
||||||
object ZipTest extends SimpleTestSuite {
|
class ZipTest extends FunSuite {
|
||||||
|
|
||||||
val blocker = Blocker.liftExecutionContext(ExecutionContext.global)
|
val blocker = Blocker.liftExecutionContext(ExecutionContext.global)
|
||||||
implicit val CS = IO.contextShift(ExecutionContext.global)
|
implicit val CS = IO.contextShift(ExecutionContext.global)
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package docspell.joex.analysis
|
package docspell.joex.analysis
|
||||||
|
|
||||||
import minitest._
|
import munit._
|
||||||
import NerFile.Pattern
|
import NerFile.Pattern
|
||||||
import java.{util => ju}
|
import java.{util => ju}
|
||||||
|
|
||||||
object NerFileTest extends SimpleTestSuite {
|
class NerFileTest extends FunSuite {
|
||||||
|
|
||||||
test("create valid case insensitive patterns") {
|
test("create valid case insensitive patterns") {
|
||||||
val names = List(
|
val names = List(
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package docspell.joex.scheduler
|
package docspell.joex.scheduler
|
||||||
|
|
||||||
import docspell.common.Priority
|
import docspell.common.Priority
|
||||||
import minitest.SimpleTestSuite
|
import munit._
|
||||||
|
|
||||||
object CountingSchemeSpec extends SimpleTestSuite {
|
class CountingSchemeSpec extends FunSuite {
|
||||||
|
|
||||||
test("counting") {
|
test("counting") {
|
||||||
val cs = CountingScheme(2, 1)
|
val cs = CountingScheme(2, 1)
|
||||||
|
@ -3,14 +3,14 @@ package docspell.store.generator
|
|||||||
import java.time.LocalDate
|
import java.time.LocalDate
|
||||||
|
|
||||||
import docspell.store.records._
|
import docspell.store.records._
|
||||||
import minitest._
|
import munit._
|
||||||
import docspell.common._
|
import docspell.common._
|
||||||
import docspell.query.ItemQueryParser
|
import docspell.query.ItemQueryParser
|
||||||
import docspell.store.queries.AttachCountTable
|
import docspell.store.queries.AttachCountTable
|
||||||
import docspell.store.qb.DSL._
|
import docspell.store.qb.DSL._
|
||||||
import docspell.store.qb.generator.{ItemQueryGenerator, Tables}
|
import docspell.store.qb.generator.{ItemQueryGenerator, Tables}
|
||||||
|
|
||||||
object ItemQueryGeneratorTest extends SimpleTestSuite {
|
class ItemQueryGeneratorTest extends FunSuite {
|
||||||
import docspell.store.impl.DoobieMeta._
|
import docspell.store.impl.DoobieMeta._
|
||||||
|
|
||||||
val tables = Tables(
|
val tables = Tables(
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package docspell.store.qb
|
package docspell.store.qb
|
||||||
|
|
||||||
import minitest._
|
import munit._
|
||||||
import docspell.store.qb.model._
|
import docspell.store.qb.model._
|
||||||
import docspell.store.qb.DSL._
|
import docspell.store.qb.DSL._
|
||||||
|
|
||||||
object QueryBuilderTest extends SimpleTestSuite {
|
class QueryBuilderTest extends FunSuite {
|
||||||
|
|
||||||
test("simple") {
|
test("simple") {
|
||||||
val c = CourseRecord.as("c")
|
val c = CourseRecord.as("c")
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package docspell.store.qb.impl
|
package docspell.store.qb.impl
|
||||||
|
|
||||||
import minitest._
|
import munit._
|
||||||
import docspell.store.qb._
|
import docspell.store.qb._
|
||||||
import docspell.store.qb.DSL._
|
import docspell.store.qb.DSL._
|
||||||
import docspell.store.qb.model.{CourseRecord, PersonRecord}
|
import docspell.store.qb.model.{CourseRecord, PersonRecord}
|
||||||
|
|
||||||
object ConditionBuilderTest extends SimpleTestSuite {
|
class ConditionBuilderTest extends FunSuite {
|
||||||
|
|
||||||
val c = CourseRecord.as("c")
|
val c = CourseRecord.as("c")
|
||||||
val p = PersonRecord.as("p")
|
val p = PersonRecord.as("p")
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package docspell.store.qb.impl
|
package docspell.store.qb.impl
|
||||||
|
|
||||||
import minitest._
|
import munit._
|
||||||
import docspell.store.qb._
|
import docspell.store.qb._
|
||||||
import docspell.store.qb.DSL._
|
import docspell.store.qb.DSL._
|
||||||
import docspell.store.qb.model.{CourseRecord, PersonRecord}
|
import docspell.store.qb.model.{CourseRecord, PersonRecord}
|
||||||
|
|
||||||
object DSLTest extends SimpleTestSuite {
|
class DSLTest extends FunSuite {
|
||||||
|
|
||||||
val course = CourseRecord.as("c")
|
val course = CourseRecord.as("c")
|
||||||
val person = PersonRecord.as("p")
|
val person = PersonRecord.as("p")
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package docspell.store.qb.impl
|
package docspell.store.qb.impl
|
||||||
|
|
||||||
import minitest._
|
import munit._
|
||||||
import docspell.store.qb._
|
import docspell.store.qb._
|
||||||
import docspell.store.qb.model._
|
import docspell.store.qb.model._
|
||||||
import docspell.store.qb.DSL._
|
import docspell.store.qb.DSL._
|
||||||
|
|
||||||
object SelectBuilderTest extends SimpleTestSuite {
|
class SelectBuilderTest extends FunSuite {
|
||||||
|
|
||||||
test("basic fragment") {
|
test("basic fragment") {
|
||||||
val c = CourseRecord.as("c")
|
val c = CourseRecord.as("c")
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package docspell.store.queries
|
package docspell.store.queries
|
||||||
|
|
||||||
import minitest._
|
import munit._
|
||||||
|
|
||||||
object QueryWildcardTest extends SimpleTestSuite {
|
class QueryWildcardTest extends FunSuite {
|
||||||
|
|
||||||
test("replace prefix") {
|
test("replace prefix") {
|
||||||
assertEquals("%name", QueryWildcard("*name"))
|
assertEquals("%name", QueryWildcard("*name"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user