From 0ca2a57b64812e26de24e7de220e4d0e1861bddf Mon Sep 17 00:00:00 2001 From: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Date: Sun, 24 Mar 2024 10:50:12 +0100 Subject: Internal Fix: RepoPattern and Tests (#1258) --- .../skyhanni/utils/repopatterns/RepoPatternManager.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/main/java/at') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt b/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt index 3e32cbcb9..27ceb7181 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.utils.repopatterns import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigManager +import at.hannibal2.skyhanni.config.features.dev.RepoPatternConfig import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.LorenzEvent import at.hannibal2.skyhanni.events.PreInitFinishedEvent @@ -45,7 +46,16 @@ object RepoPatternManager { true } - private val config get() = SkyHanniMod.feature.dev.repoPattern + private val insideTest = Launch.blackboard == null + + private val config + get() = if (!insideTest) { + SkyHanniMod.feature.dev.repoPattern + } else { + RepoPatternConfig().apply { + tolerateDuplicateUsage = true + } + } /** * Crash if in a development environment, or if inside a guarded event handler. -- cgit