Add flag to turn power assertions on/off (#1419)

This commit is contained in:
Islon Scherer
2026-02-03 09:35:16 +01:00
committed by GitHub
parent 7b7b51c0ae
commit f0449c8330
29 changed files with 345 additions and 72 deletions
@@ -28,7 +28,7 @@ import org.pkl.core.ModuleSource.*
class EvaluateTestsTest {
private val evaluator = Evaluator.preconfigured()
private val evaluator = EvaluatorBuilder.preconfigured().setPowerAssertionsEnabled(true).build()
@Test
fun `test successful module`() {
@@ -1,5 +1,5 @@
/*
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -178,6 +178,7 @@ class LanguageSnippetTestsEngine : AbstractLanguageSnippetTestsEngine() {
.addCertificates(FileTestUtils.selfSignedCertificate)
.buildLazily()
)
.setPowerAssertionsEnabled(true)
}
override val testClass: KClass<*> = LanguageSnippetTests::class
@@ -200,6 +201,7 @@ class LanguageSnippetTestsEngine : AbstractLanguageSnippetTestsEngine() {
null,
StackFrameTransformers.empty,
mapOf(),
true, // enable power assertions for tests
)
securityManager = null
applyFromProject(project)