MCPcopy Create free account

hub / github.com/ZhangShenao/harness9 / functions

Functions1,385 in github.com/ZhangShenao/harness9

FunctionTestDefaultConfig_FromEnv
(t *testing.T)
internal/sandbox/config_test.go:39
FunctionTestDefinitionValidate
(t *testing.T)
internal/subagent/definition_test.go:8
FunctionTestDispatchMentionEmptyTask
(t *testing.T)
cmd/harness9/tui_test.go:903
FunctionTestDispatchMentionUnknownAgent
--- @agent 前台直跑测试 ---
cmd/harness9/tui_test.go:891
FunctionTestDispatch_ClearsPendingShellOutputAfterInject
(t *testing.T)
cmd/harness9/tui_test.go:878
FunctionTestDispatch_InjectsPendingShellOutput
(t *testing.T)
cmd/harness9/tui_test.go:866
FunctionTestDockerEnvironmentIntegration_RunBash
(t *testing.T)
internal/sandbox/docker_environment_integration_test.go:13
FunctionTestDockerEnvironment_Close
(t *testing.T)
internal/sandbox/docker_environment_test.go:49
FunctionTestDockerEnvironment_ID
(t *testing.T)
internal/sandbox/docker_environment_test.go:12
FunctionTestDockerEnvironment_ReadWriteFile
(t *testing.T)
internal/sandbox/docker_environment_test.go:56
FunctionTestDockerEnvironment_RunBash_CommandFails
(t *testing.T)
internal/sandbox/docker_environment_test.go:36
FunctionTestDockerEnvironment_RunBash_Success
(t *testing.T)
internal/sandbox/docker_environment_test.go:19
FunctionTestDockerEnvironment_WriteFile_AutoMkdir
(t *testing.T)
internal/sandbox/docker_environment_test.go:73
FunctionTestDownloadFile
(t *testing.T)
cmd/harness9/upgrade_test.go:212
FunctionTestDownloadFileHTTPError
(t *testing.T)
cmd/harness9/upgrade_test.go:230
FunctionTestEditFileTool_Definition
(t *testing.T)
internal/tools/edit_file_test.go:19
FunctionTestEditFileTool_Execute_BadJSON
(t *testing.T)
internal/tools/edit_file_test.go:33
FunctionTestEditFileTool_Execute_EmptyFile
空文件编辑测试
internal/tools/edit_file_test.go:636
FunctionTestEditFileTool_Execute_FileNotFound
(t *testing.T)
internal/tools/edit_file_test.go:54
FunctionTestEditFileTool_Execute_L1_ExactMatch
验证写入文件后内容正确性
internal/tools/edit_file_test.go:388
FunctionTestEditFileTool_Execute_PathTraversal
(t *testing.T)
internal/tools/edit_file_test.go:41
FunctionTestEditFileTool_Execute_Success
完整的 Execute 链路测试
internal/tools/edit_file_test.go:268
FunctionTestEditFileTool_Name
(t *testing.T)
internal/tools/edit_file_test.go:12
FunctionTestEditFile_ExactMatch_AuthoritativeBanner
TestEditFile_ExactMatch_AuthoritativeBanner 验证精确匹配仍声明权威无需复核。
internal/tools/edit_file_test.go:601
FunctionTestEditFile_FuzzyMatch_CautionBanner
TestEditFile_FuzzyMatch_CautionBanner 验证模糊匹配(L3/L4)的成功提示 不再声称"无需确认",而是建议复核(避免在最该验证时抑制自愈)。
internal/tools/edit_file_test.go:578
FunctionTestEngineObserver_CallSequence
TestEngineObserver_CallSequence 验证 EngineObserver 的回调顺序和参数正确性。
internal/engine/agent_loop_test.go:604
FunctionTestEngineObserver_NilFallback
TestEngineObserver_NilFallback 验证不注入 observer 时 nil 自动降级为 noop 不会 panic。
internal/engine/agent_loop_test.go:697
FunctionTestEntryExpired
(t *testing.T)
internal/ltm/entry_test.go:19
FunctionTestErrorAssertion
(t *testing.T)
internal/evals/assertions_test.go:78
FunctionTestErrorHandling
TestErrorHandling 运行错误处理能力评估(3 个黄金用例)。
internal/evals/dataset/error_handling_test.go:16
FunctionTestEstimateTokens_ContentOnly
(t *testing.T)
internal/memory/token_test.go:17
FunctionTestEstimateTokens_Empty
(t *testing.T)
internal/memory/token_test.go:10
FunctionTestEstimateTokens_WithToolCallID
(t *testing.T)
internal/memory/token_test.go:44
FunctionTestEstimateTokens_WithToolCalls
(t *testing.T)
internal/memory/token_test.go:28
FunctionTestEstimateToolTokens_Basic
(t *testing.T)
internal/memory/token_test.go:62
FunctionTestEstimateToolTokens_Empty
(t *testing.T)
internal/memory/token_test.go:55
FunctionTestEventActionDelta_AppendsToLastLine
(t *testing.T)
cmd/harness9/tui_test.go:34
FunctionTestEventActionDelta_FlushesThinkingBlock
(t *testing.T)
cmd/harness9/tui_test.go:445
FunctionTestEventActionDelta_InitializesEmptyLines
(t *testing.T)
cmd/harness9/tui_test.go:50
FunctionTestEventDone_FlushesActiveThinkingBlock
(t *testing.T)
cmd/harness9/tui_test.go:490
FunctionTestEventDone_ResetsRunningState
(t *testing.T)
cmd/harness9/tui_test.go:119
FunctionTestEventError_AppendsToScrollbackAndResetsRunning
(t *testing.T)
cmd/harness9/tui_test.go:140
FunctionTestEventError_ResetsThinkingBlock
TestEventError_ResetsThinkingBlock 验证 EventError 在 thinking 块活跃时, 正确截断 lines(移除从 thinkingLineStart 起的所有行)并重置 thinkingLineStart。
cmd/harness9/tui_test.go:550
FunctionTestEventThinkingDelta_AccumulatesContent
(t *testing.T)
cmd/harness9/tui_test.go:433
FunctionTestEventThinkingDelta_CreatesThinkingBlock
(t *testing.T)
cmd/harness9/tui_test.go:408
FunctionTestEventThinkingDelta_NoBlankLineBeforeHeader
TestEventThinkingDelta_NoBlankLineBeforeHeader 验证 thinking 块头部(« thinking ») 直接追加在 "◆ harness9:" 之后,不出现孤立的空行占位符。
cmd/harness9/tui_test.go:583
FunctionTestEventToolResult_ClearsCurrentToolAndAppendsLine
(t *testing.T)
cmd/harness9/tui_test.go:82
FunctionTestEventToolResult_ErrorMark
(t *testing.T)
cmd/harness9/tui_test.go:102
FunctionTestEventToolStart_FlushesThinkingBlock
(t *testing.T)
cmd/harness9/tui_test.go:470
FunctionTestEventToolStart_SetsCurrentTool
(t *testing.T)
cmd/harness9/tui_test.go:64
FunctionTestExtractBinary
(t *testing.T)
cmd/harness9/upgrade_test.go:55
FunctionTestExtractContentBasic
(t *testing.T)
internal/tools/web_content_test.go:8
FunctionTestExtractContentOversizedBody
(t *testing.T)
internal/tools/web_content_test.go:76
FunctionTestExtractContentTruncation
(t *testing.T)
internal/tools/web_content_test.go:36
FunctionTestExtractPlainText
(t *testing.T)
internal/tools/web_content_test.go:56
FunctionTestExtractReasoningContent_AbsentField
(t *testing.T)
internal/provider/openai_reasoning_test.go:68
FunctionTestExtractReasoningContent_EmptyChoices
(t *testing.T)
internal/provider/openai_reasoning_test.go:76
FunctionTestExtractReasoningContent_InvalidJSON
(t *testing.T)
internal/provider/openai_reasoning_test.go:84
FunctionTestExtractReasoningContent_PresentField
(t *testing.T)
internal/provider/openai_reasoning_test.go:51
FunctionTestExtractReasoningContent_PriorityReasoningContent
TestExtractReasoningContent_PriorityReasoningContent 验证当两个字段同时存在时, reasoning_content 优先于 reasoning 返回(DeepSeek-R1 原生格式优先)。
internal/provider/openai_reasoning_test.go:94
FunctionTestExtractReasoningContent_ReasoningField
(t *testing.T)
internal/provider/openai_reasoning_test.go:59
FunctionTestExtractorFailOpen
(t *testing.T)
internal/ltm/extractor_test.go:39
FunctionTestExtractorIgnoresEmptyArray
(t *testing.T)
internal/ltm/extractor_test.go:50
FunctionTestExtractorUpsertsFacts
(t *testing.T)
internal/ltm/extractor_test.go:24
FunctionTestFailure_Error
(t *testing.T)
internal/evals/assertions_test.go:125
FunctionTestFetchLatestRelease
(t *testing.T)
cmd/harness9/upgrade_test.go:242
FunctionTestFilePlanWriter_AllStatuses
(t *testing.T)
internal/hooks/plan_writer_test.go:104
FunctionTestFilePlanWriter_GitProject_WritesToWorkDir
(t *testing.T)
internal/hooks/plan_writer_test.go:49
FunctionTestFilePlanWriter_NonGitProject_WritesToHomeDir
(t *testing.T)
internal/hooks/plan_writer_test.go:13
FunctionTestFilePlanWriter_Overwrite
(t *testing.T)
internal/hooks/plan_writer_test.go:80
FunctionTestFinalize_ContiguousIndices
TestFinalize_ContiguousIndices 验证常规(OpenAI)密集 index 从 0 起的情形。
internal/provider/tool_call_accumulator_test.go:6
FunctionTestFinalize_Empty
TestFinalize_Empty 验证无工具调用时返回 nil。
internal/provider/tool_call_accumulator_test.go:61
FunctionTestFinalize_OutOfOrderArrival
TestFinalize_OutOfOrderArrival 验证乱序到达的 index 也按升序输出。
internal/provider/tool_call_accumulator_test.go:42
FunctionTestFinalize_SparseIndices
TestFinalize_SparseIndices 是核心回归测试:当 index 不从 0 开始(Anthropic 在 thinking/text 块占据 index 0 时,tool_use 块从 index 1 起,key 集合形如 {1,2}), 旧实现 `for i:=0;i<len(
internal/provider/tool_call_accumulator_test.go:25
FunctionTestFindAssetURL
(t *testing.T)
cmd/harness9/upgrade_test.go:282
FunctionTestFlushPendingThinking_UpdatesPendingReplyStart
TestFlushPendingThinking_UpdatesPendingReplyStart 验证 flushPendingThinking 后 pendingReplyStart 被更新到 thinking 结束行之后,后续 action 文本从正确位置写入。
cmd/harness9/tui_test.go:1065
FunctionTestFormatJSON
TestFormatJSON 验证 JSON 渲染的三类分支:空输入、短 payload 内联、长 payload pretty-print。
internal/logfmt/format_test.go:13
FunctionTestFormatJSON_LongPayloadIsPretty
TestFormatJSON_LongPayloadIsPretty 验证超过 argInlineThreshold 的 payload 被 pretty-print 并加缩进。
internal/logfmt/format_test.go:34
FunctionTestFormatJSON_NoHTMLEscape
TestFormatJSON_NoHTMLEscape 验证 &、<、> 字符不被转义为 \uXXXX 形式。 这是日志可读性的关键 — 命令中常见的 && 必须原样显示,不能出现 & 这种 Unicode 转义。
internal/logfmt/format_test.go:48
FunctionTestFormatLoopEnd
TestFormatLoopEnd 验证结束日志包含 turns 和 total 字段。
internal/logfmt/format_test.go:223
FunctionTestFormatLoopStart
TestFormatLoopStart 验证启动日志包含所有关键参数字段。
internal/logfmt/format_test.go:203
FunctionTestFormatMsg
TestFormatMsg 验证通用单行日志条目的前缀拼接格式。
internal/logfmt/format_test.go:194
FunctionTestFormatOutput
TestFormatOutput 验证基础输出渲染:单行、多行、空输入、超长截断。
internal/logfmt/format_test.go:69
FunctionTestFormatTokenCount
(t *testing.T)
internal/memory/token_test.go:73
FunctionTestFormatToolDone
TestFormatToolDone 验证 status 与耗时格式化、成功/失败标签切换、截断后缀。
internal/logfmt/format_test.go:146
FunctionTestFormatToolStart
TestFormatToolStart 验证工具启动条目的头部 + arguments 渲染。
internal/logfmt/format_test.go:130
FunctionTestFormatTurnStart
TestFormatTurnStart 验证 Turn 头部日志包含 turn 编号、history 和 tools 字段。
internal/logfmt/format_test.go:213
FunctionTestFtsQuery
TestFtsQuery 验证 ftsQuery 将用户输入安全转换为 FTS5 MATCH 表达式: 每个 token 被双引号包裹(内部双引号翻倍转义),以 OR 连接。
internal/ltm/store_test.go:233
FunctionTestFuzzyReplace_L1_ExactMatch
L1: 精确匹配替换
internal/tools/edit_file_test.go:65
FunctionTestFuzzyReplace_L1_MultipleMatch_Error
L1: 精确匹配多处 → 返回错误
internal/tools/edit_file_test.go:90
FunctionTestFuzzyReplace_L1_PreserveOriginalFormatting
L1: 原始文本精确匹配,保留原始格式(包括 \r\n)
internal/tools/edit_file_test.go:373
FunctionTestFuzzyReplace_L2_CRLFInSourceText
L2: CRLF 文件中 source_text 也带 CRLF
internal/tools/edit_file_test.go:126
FunctionTestFuzzyReplace_L2_CRLFInTargetText
L2: CRLF 文件中 target_text 含 CRLF
internal/tools/edit_file_test.go:141
FunctionTestFuzzyReplace_L2_CRLFNormalization
L2: 换行符归一化匹配(CRLF → LF)
internal/tools/edit_file_test.go:107
FunctionTestFuzzyReplace_L2_TrueLineEndingNormalization
L2: 真正测试换行符归一化 — CRLF 文件中使用纯 LF 的多行 source_text
internal/tools/edit_file_test.go:407
FunctionTestFuzzyReplace_L3_EmptySourceTrimmed
L3: 空 source_text 不应进入 L3
internal/tools/edit_file_test.go:361
FunctionTestFuzzyReplace_L3_LeadingTrailingWhitespace
L3: 测试 source_text 带有额外首尾空白的情况
internal/tools/edit_file_test.go:427
FunctionTestFuzzyReplace_L3_TrimmedMatch
L3: 整体首尾去空匹配
internal/tools/edit_file_test.go:156
FunctionTestFuzzyReplace_L4_CRLFPreservation
L4: 验证 lineByLineReplace 对 CRLF 文件的保留
internal/tools/edit_file_test.go:651
FunctionTestFuzzyReplace_L4_IndentAgnostic
L4: 缩进不一致时的模糊匹配
internal/tools/edit_file_test.go:210
← previousnext →801–900 of 1,385, ranked by callers