mirror of
https://github.com/digital-asset/daml.git
synced 2024-11-10 10:46:11 +03:00
Remove hardcoded number of packages from Java codegen test (#4604)
This breaks everytime we change the number of packages in damlc which is rather annoying. changelog_begin changelog_end
This commit is contained in:
parent
f22ea41251
commit
ff90ec643e
@ -77,6 +77,8 @@ da_scala_test(
|
||||
deps = [
|
||||
":lib",
|
||||
"//bazel_tools/runfiles:scala_runfiles",
|
||||
"//daml-lf/archive:daml_lf_archive_reader",
|
||||
"//daml-lf/archive:daml_lf_dev_archive_java_proto",
|
||||
"//daml-lf/data",
|
||||
"//daml-lf/interface",
|
||||
"//language-support/codegen-common",
|
||||
|
@ -7,6 +7,7 @@ import java.io.File
|
||||
import java.nio.file.Files
|
||||
|
||||
import com.digitalasset.daml.bazeltools.BazelRunfiles
|
||||
import com.digitalasset.daml.lf.archive.DarReader
|
||||
import com.digitalasset.daml.lf.codegen.backend.java.JavaBackend
|
||||
import com.digitalasset.daml.lf.codegen.conf.Conf
|
||||
import org.scalatest.{FlatSpec, Matchers}
|
||||
@ -19,6 +20,7 @@ class CodeGenRunnerTests extends FlatSpec with Matchers with BazelRunfiles {
|
||||
def path(p: String) = new File(p).getAbsoluteFile.toPath
|
||||
|
||||
val testDar = path(rlocation("language-support/java/codegen/test-daml.dar"))
|
||||
val dar = DarReader().readArchiveFromFile(testDar.toFile).get
|
||||
|
||||
val dummyOutputDir = Files.createTempDirectory("codegen")
|
||||
|
||||
@ -48,8 +50,8 @@ class CodeGenRunnerTests extends FlatSpec with Matchers with BazelRunfiles {
|
||||
|
||||
val (interfaces, pkgPrefixes) = CodeGenRunner.collectDamlLfInterfaces(conf)
|
||||
|
||||
assert(interfaces.map(_.packageId).length == 19)
|
||||
assert(pkgPrefixes.size == 19)
|
||||
assert(interfaces.map(_.packageId).length == dar.all.length)
|
||||
assert(pkgPrefixes.size == dar.all.length)
|
||||
assert(pkgPrefixes.values.forall(_ == "PREFIX"))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user