mirror of
https://github.com/jihe520/MathModelAgent.git
synced 2026-10-15 04:59:42 +08:00
- 后端按 Google Python Style Guide 重构注释,修复 ruff 和 pyright 错误(161→0) - 前端按 Vue.js Style Guide 重构注释,修复 biome 错误 - 添加 PostToolUse lint hook(ruff + biome 自动检查) - 更新 CLAUDE.md 覆盖 Commands/Testing/Structure/CodeStyle/GitWorkflow/Boundaries - 修复 tsconfig.json 废弃的 baseUrl 配置
21 lines
538 B
Python
21 lines
538 B
Python
"""通用工具函数单元测试。"""
|
|
|
|
import unittest
|
|
|
|
from app.utils.common_utils import split_footnotes
|
|
|
|
|
|
class TestCommonUtils(unittest.TestCase):
|
|
"""测试 common_utils 模块的核心函数。"""
|
|
|
|
def test_split_footnotes(self):
|
|
"""测试脚注分离功能。"""
|
|
text = "Example[^1]\n\n[^1]: Footnote content"
|
|
main, notes = split_footnotes(text)
|
|
self.assertEqual(main, "Example")
|
|
self.assertEqual(notes, [("1", "Footnote content")])
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|