功能:配置文件支持中文注释,版本 26.9.13

This commit is contained in:
SKYMirror committed 2026-09-13 04:03:47 +08:00
1 parent 0d6c911126
commit 89fdf3619d
6 files changed
+128 -9

No files matched your search

+12
View File
@@ -267,6 +267,18 @@ def test_extract_display_name():
assert "kubejs:time_twister_wireless" not in disp
def test_strip_json_comments():
import json
from iridium.config import DEFAULT_CONFIG_TEXT, _strip_json_comments
parsed = json.loads(_strip_json_comments(DEFAULT_CONFIG_TEXT))
assert parsed["permission"] == 1
assert "skymirror.top" in parsed["motd_lines"][2]
# comment-looking text inside string is kept
assert json.loads(_strip_json_comments('{"a": "http://x"}'))["a"] == "http://x"
if __name__ == "__main__":
fns = [v for k, v in sorted(globals().items()) if k.startswith("test_") and callable(v)]
failed = 0