mirror of
https://github.com/LamGC/ScalaBot.git
synced 2025-07-04 06:17:23 +00:00
test(config): 补充相关的单元测试.
经检查, 已确定完全覆盖代码, 为完成单元测试的编写, 稍微改了一下 AppPaths 的代码, 不会有影响的 :P
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user