MaaAssistantArknights / maa-cli

MAA命令行工具 | A simple CLI for MAA.
GNU Affero General Public License v3.0
40 stars 8 forks source link

rust test 与已有环境变量冲突 #301

Closed DarkPaper2022 closed 3 months ago

DarkPaper2022 commented 3 months ago

我在arch中的构建过程中出现了如下错误,其中 left 的值是我设置的环境变量 MAA_CONFIG_DIR

failures:

---- dirs::tests::get_dir::config_relative stdout ----
thread 'dirs::tests::get_dir::config_relative' panicked at maa-cli/src/dirs.rs:659:17:
assertion `left == right` failed
  left: "/home/darkpaper/Game/maa/dp_tasks"
 right: "/home/darkpaper/.config/maa"

failures:
    dirs::tests::get_dir::config_relative

这个问题我通过在pkgbuild中临时 unset MAA_CONFIG_DIR 来解决,我推测也可以在 test 中做相应处理来解决。

wangl-cc commented 3 months ago

感谢反馈,目前只对 XDG* 相关的环境变量做了处理,忽略了 MAA* 相关变量。