Use ChoiceFormat for better plurals in error messages (#1848)

This commit is contained in:
Jen Basch
2026-09-10 22:03:05 +00:00
committed by GitHub
parent 90245589b6
commit 574ad844f3
6 changed files with 30 additions and 11 deletions
@@ -530,8 +530,27 @@ class EmbeddedExecutorTest {
timeout(Duration.ofSeconds(1))
}
}
assertThat(e.message)
.containsAnyOf(
"Evaluation timed out after 1 second.",
"Evaluation timed out after 1 second(s).",
)
assertThat(e.message).contains("Evaluation timed out after 1 second(s).")
val e2 =
assertThrows<ExecutorException> {
executor.evaluatePath(pklFile) {
allowedModules("file:")
allowedResources("prop:")
rootDir(tempDir)
timeout(Duration.ofMillis(1500))
}
}
assertThat(e2.message)
.containsAnyOf(
"Evaluation timed out after 1.5 seconds.",
"Evaluation timed out after 1.5 second(s).",
)
}
@Test