MCPcopy Create free account

hub / github.com/ZhangShenao/harness9 / functions

Functions1,385 in github.com/ZhangShenao/harness9

FunctionTestManager_NewAndListSessions
(t *testing.T)
internal/memory/manager_test.go:12
FunctionTestManager_NoBootstrapByDefault
TestManager_NoBootstrapByDefault 验证:默认(BootstrapCmd 为空)不触发任何 exec 调用。
internal/sandbox/manager_test.go:46
FunctionTestManager_OpenExistingSession
(t *testing.T)
internal/memory/manager_test.go:43
FunctionTestManager_OpenNonExistentSession
(t *testing.T)
internal/memory/manager_test.go:67
FunctionTestManager_Start_Success
TestManager_Start_Success 直接向 manager 注入已连接的 Client, 验证 Statuses() 返回正确的连接状态与 ToolsLen。
internal/mcp/manager_test.go:52
FunctionTestManager_WithUpdateNotify
(t *testing.T)
internal/sandbox/manager_test.go:162
FunctionTestMaxToolCallsAssertion_IsSoft
(t *testing.T)
internal/evals/assertions_test.go:107
FunctionTestMaxToolCallsAssertion_Pass
(t *testing.T)
internal/evals/assertions_test.go:118
FunctionTestMaxTurnsAssertion_IsSoft
(t *testing.T)
internal/evals/assertions_test.go:89
FunctionTestMaxTurnsAssertion_Pass
(t *testing.T)
internal/evals/assertions_test.go:100
FunctionTestMaxTurnsLimit
TestMaxTurnsLimit 验证 MaxTurns 安全阀:LLM 持续发起工具调用时,达到上限后强制退出。
internal/engine/agent_loop_test.go:219
FunctionTestMemory
TestMemory 运行 Memory 能力评估(2 个黄金用例)。 memory_write / memory_search 工具需要 SQLite 数据库,在 eval 隔离环境下未注册。 未注册的工具由 Registry.Execute 返回 IsError=true 的 ToolResu
internal/evals/dataset/memory_test.go:18
FunctionTestMemoryNudgeInjectedEveryNTurns
TestMemoryNudgeInjectedEveryNTurns 验证 WithMemoryNudge 在指定 turn 间隔向 LLM 历史注入 nudge 提示。
internal/engine/agent_loop_test.go:543
FunctionTestMemoryNudgeNotPersisted
TestMemoryNudgeNotPersisted 验证 nudge 仅注入每轮发送给 LLM 的临时副本, 绝不写入持久化的 Session(contextHistory 不被污染)。
internal/engine/agent_loop_test.go:575
FunctionTestMemorySearchExecute
(t *testing.T)
internal/tools/memory_search_test.go:15
FunctionTestMemorySearchNoHit
(t *testing.T)
internal/tools/memory_search_test.go:34
FunctionTestMemorySession_AddAndGet
(t *testing.T)
internal/memory/mem_session_test.go:11
FunctionTestMemorySession_Clear
(t *testing.T)
internal/memory/mem_session_test.go:94
FunctionTestMemorySession_GetWithLimit
(t *testing.T)
internal/memory/mem_session_test.go:39
FunctionTestMemorySession_PopEmpty
(t *testing.T)
internal/memory/mem_session_test.go:82
FunctionTestMemorySession_PopMessage
(t *testing.T)
internal/memory/mem_session_test.go:60
FunctionTestMemoryWriteAdd
(t *testing.T)
internal/tools/memory_write_test.go:30
FunctionTestMemoryWriteBadAction
(t *testing.T)
internal/tools/memory_write_test.go:63
FunctionTestMemoryWriteRemove
(t *testing.T)
internal/tools/memory_write_test.go:46
FunctionTestMemoryWriteUpdatePreservesOmittedContent
(t *testing.T)
internal/tools/memory_write_test.go:70
FunctionTestMockProvider_GenerateStream_EndsWithDoneChunk
(t *testing.T)
internal/provider/providertest/mock_test.go:83
FunctionTestMockProvider_GenerateStream_ThinkingPhaseHasTextDelta
(t *testing.T)
internal/provider/providertest/mock_test.go:105
FunctionTestMockProvider_GenerateStream_Turn1HasToolCallsInDoneChunk
(t *testing.T)
internal/provider/providertest/mock_test.go:124
FunctionTestMockProvider_ThinkingPhase_DoesNotIncrementTurnCounter
(t *testing.T)
internal/provider/providertest/mock_test.go:62
FunctionTestMockProvider_ThinkingPhase_ReturnsContent
(t *testing.T)
internal/provider/providertest/mock_test.go:10
FunctionTestMockProvider_Turn1_RequestsToolCall
(t *testing.T)
internal/provider/providertest/mock_test.go:27
FunctionTestMockProvider_Turn2_ReturnsFinalReply
(t *testing.T)
internal/provider/providertest/mock_test.go:43
FunctionTestMouseWheelDown_AtBottom_NoChange
(t *testing.T)
cmd/harness9/tui_test.go:259
FunctionTestMouseWheelUp_ScrollsUp
(t *testing.T)
cmd/harness9/tui_test.go:243
FunctionTestMoveOrCopy
(t *testing.T)
cmd/harness9/upgrade_test.go:310
FunctionTestNewRegistry_IsEmpty
(t *testing.T)
internal/tools/registry_test.go:60
FunctionTestNewTransport_AutoInferStdio
TestNewTransport_AutoInferStdio 验证无 Type 但有 Command 时自动推断为 stdio。
internal/mcp/transport_test.go:109
FunctionTestNewTransport_HTTP
TestNewTransport_HTTP 验证 http 类型创建 HTTPTransport。
internal/mcp/transport_test.go:79
FunctionTestNewTransport_HTTPMissingURL
TestNewTransport_HTTPMissingURL 验证 http 类型缺少 URL 字段时返回错误。
internal/mcp/transport_test.go:91
FunctionTestNewTransport_Stdio
---- newTransport 工厂函数测试 ---- TestNewTransport_Stdio 验证 stdio 类型创建 StdioTransport。
internal/mcp/transport_test.go:58
FunctionTestNewTransport_StdioMissingCommand
TestNewTransport_StdioMissingCommand 验证 stdio 类型缺少 Command 字段时返回错误。
internal/mcp/transport_test.go:70
FunctionTestNewTransport_Unknown
TestNewTransport_Unknown 验证未知 Type 时返回错误。
internal/mcp/transport_test.go:100
FunctionTestNoErrorAssertion
(t *testing.T)
internal/evals/assertions_test.go:67
FunctionTestNoopProviderSatisfiesInterface
(t *testing.T)
internal/ltm/provider_test.go:10
FunctionTestOTELEngineObserver_ErrorPropagation
(t *testing.T)
internal/observability/observer_test.go:38
FunctionTestOTELEngineObserver_LifecycleNoPanic
(t *testing.T)
internal/observability/observer_test.go:16
FunctionTestOTELEngineObserver_Multipleturns
(t *testing.T)
internal/observability/observer_test.go:146
FunctionTestOTELEngineObserver_NilSpanSafety
(t *testing.T)
internal/observability/observer_test.go:48
FunctionTestOTELEngineObserver_SpanLinkage
TestOTELEngineObserver_SpanLinkage 用真实 SpanRecorder 验证 interaction/turn/llm_request 三层 span 的 trace_id 相同且父子关系正确。这是 Langfuse 分组显示的核心前提。
internal/observability/observer_test.go:64
FunctionTestObservabilityHook_BeforeAndAfter
(t *testing.T)
internal/observability/hook_test.go:15
FunctionTestObservabilityHook_ErrorTool
(t *testing.T)
internal/observability/hook_test.go:41
FunctionTestOffloadHook_AboveThreshold_WritesFile
(t *testing.T)
internal/hooks/offload_test.go:31
FunctionTestOffloadHook_BeforeExecute_Noop
(t *testing.T)
internal/hooks/offload_test.go:113
FunctionTestOffloadHook_BelowThreshold_NoOffload
(t *testing.T)
internal/hooks/offload_test.go:14
FunctionTestOffloadHook_EmptyToolCallID_NoOffload
(t *testing.T)
internal/hooks/offload_test.go:63
FunctionTestOffloadHook_ExcludedTools_NoOffload
(t *testing.T)
internal/hooks/offload_test.go:77
FunctionTestOffloadHook_WriteFailure_ReturnsOriginal
(t *testing.T)
internal/hooks/offload_test.go:92
FunctionTestOutputContainsAssertion
(t *testing.T)
internal/evals/assertions_test.go:47
FunctionTestOutputExcludesAssertion
(t *testing.T)
internal/evals/assertions_test.go:57
FunctionTestParseAgentFile
(t *testing.T)
internal/subagent/frontmatter_test.go:5
FunctionTestParseAgentFileNoFrontmatter
(t *testing.T)
internal/subagent/frontmatter_test.go:48
FunctionTestParseAgentFileQuotedAndEmpty
(t *testing.T)
internal/subagent/frontmatter_test.go:54
FunctionTestParseDDGResults
(t *testing.T)
internal/tools/web_search_test.go:35
FunctionTestParseDDGResultsMaxResults
(t *testing.T)
internal/tools/web_search_test.go:51
FunctionTestParseFrontmatter_MissingClosingDelimiter
(t *testing.T)
internal/skills/skills_test.go:54
FunctionTestParseFrontmatter_NoFrontmatter
(t *testing.T)
internal/skills/skills_test.go:43
FunctionTestParseFrontmatter_NoTrigger
(t *testing.T)
internal/skills/skills_test.go:65
FunctionTestParseFrontmatter_QuotedValues
(t *testing.T)
internal/skills/skills_test.go:29
FunctionTestParseFrontmatter_Valid
(t *testing.T)
internal/skills/skills_test.go:12
FunctionTestParseLine
TestParseLine 使用表驱动测试(Table-Driven Tests)验证 parseLine 的各种边界情况: 普通键值对、双引号值去除、空值、带空格的键值、注释行、无等号行、 无键行、不匹配引号(不应去除)、无引号值。
internal/env/env_test.go:89
FunctionTestParseTestIDs
TestParseTestIDs 验证把 SWE-bench 中"JSON 编码为字符串的测试 ID 数组"解析为 []string。
cmd/swebench/dataset_test.go:98
FunctionTestPathLocker_ConcurrentReadWrite
TestPathLocker_ConcurrentReadWrite 验证并发场景下读写锁的正确性。 模拟多个读操作和写操作在同一个路径上并发执行, 写锁排他、读锁共享的行为应始终保持一致。
internal/tools/path_locker_test.go:192
FunctionTestPathLocker_ConcurrentReaders
TestPathLocker_ConcurrentReaders 验证大量并发读者能共享同一路径的读锁。
internal/tools/path_locker_test.go:263
FunctionTestPathLocker_IsolatedPaths
TestPathLocker_IsolatedPaths 验证不同路径的锁互不影响。 对一个路径加锁不应阻塞对另一路径的加锁操作。
internal/tools/path_locker_test.go:171
FunctionTestPathLocker_RefCounting
TestPathLocker_RefCounting 验证引用计数正确归零。 多次加锁解锁后,确认 map 中的条目被正确清理。
internal/tools/path_locker_test.go:129
FunctionTestPermissionHook_AfterExecute_PassThrough
(t *testing.T)
internal/permission/hook_test.go:59
FunctionTestPermissionHook_Allow
(t *testing.T)
internal/permission/hook_test.go:27
FunctionTestPermissionHook_Ask_DefaultMediumRisk
(t *testing.T)
internal/permission/hook_test.go:42
FunctionTestPermissionHook_Deny
(t *testing.T)
internal/permission/hook_test.go:12
FunctionTestPhaseStaysChat_AfterFirstEnter
(t *testing.T)
cmd/harness9/tui_test.go:359
FunctionTestPhaseTransition_WelcomeToChat
(t *testing.T)
cmd/harness9/tui_test.go:345
FunctionTestPlanMode_Label
(t *testing.T)
internal/planning/mode_test.go:37
FunctionTestPlanMode_Next_Cycles
(t *testing.T)
internal/planning/mode_test.go:9
FunctionTestPlanMode_String
(t *testing.T)
internal/planning/mode_test.go:21
FunctionTestPlanning
TestPlanning 运行 Planning 能力评估(2 个黄金用例)。
internal/evals/dataset/planning_test.go:12
FunctionTestPlanningExecution
TestPlanningExecution 验证从计划生成到执行的完整流程(2 个黄金用例)。
internal/evals/dataset/planning_test.go:90
FunctionTestPrecisByteCap
(t *testing.T)
internal/ltm/precis_test.go:37
FunctionTestPrecisReadMissing
(t *testing.T)
internal/ltm/precis_test.go:62
FunctionTestPrecisRegenerateAndRead
(t *testing.T)
internal/ltm/precis_test.go:13
FunctionTestPromptBuilderBuild
(t *testing.T)
internal/subagent/prompt_test.go:8
FunctionTestPromptBuilderSandboxContextChaining
(t *testing.T)
internal/subagent/prompt_test.go:68
FunctionTestPromptBuilderSkillLoadErrorIgnored
(t *testing.T)
internal/subagent/prompt_test.go:30
FunctionTestPromptBuilderWithSandboxContext
(t *testing.T)
internal/subagent/prompt_test.go:40
FunctionTestPromptBuilderWithSkills
(t *testing.T)
internal/subagent/prompt_test.go:19
FunctionTestPromptBuilderWithoutSandboxContext
(t *testing.T)
internal/subagent/prompt_test.go:60
FunctionTestRLockPath_MultipleReaders
TestRLockPath_MultipleReaders 验证多个 goroutine 可同时持有同一路径的读锁。 如果读锁不是共享的,测试将因无法同时获取两把读锁而超时。
internal/tools/path_locker_test.go:20
FunctionTestReact_BasicFlow
TestReact_BasicFlow 验证单阶段 ReAct 的完整流程: Turn 1: LLM Action(携带工具调用)→ Observation Turn 2: LLM Action(最终回复,无工具调用)→ 终止
internal/engine/agent_loop_test.go:178
FunctionTestReadExpectedChecksum
(t *testing.T)
cmd/harness9/upgrade_test.go:158
FunctionTestReadExpectedChecksumEmptyFile
fakeScanner 用于在测试中替换 bufio.Scanner 的输入源(间接验证 readExpectedChecksum)。
cmd/harness9/upgrade_test.go:327
FunctionTestReadFileTool_Definition
(t *testing.T)
internal/tools/read_file_test.go:18
← previousnext →1,001–1,100 of 1,385, ranked by callers