test(config): 补充相关的单元测试.

经检查, 已确定完全覆盖代码, 为完成单元测试的编写, 稍微改了一下 AppPaths 的代码, 不会有影响的 :P
This commit is contained in:
2022-07-12 01:20:53 +08:00
parent 8c4e48e3eb
commit 92b7e84b3a
2 changed files with 296 additions and 9 deletions

View File

@ -167,6 +167,21 @@ internal enum class AppPaths(
}
}
/**
* 一个内部方法, 用于将 [initialized] 状态重置.
*
* 如果不重置该状态, 将使得单元测试无法让 AppPath 重新初始化文件.
*
* 警告: 该方法不应该被非测试代码调用.
*/
@Suppress("unused")
private fun reset() {
log.warn {
"初始化状态已重置: `${this.name}`, 如果在非测试环境中重置状态, 请报告该问题."
}
initialized.set(false)
}
override fun toString(): String {
return path
}