This commit is contained in:
2026-08-10 13:33:45 +07:00
parent 3891099eaa
commit 1b69f69c7d
5 changed files with 68 additions and 20 deletions
+10 -5
View File
@@ -102,8 +102,13 @@ TOOLS_DIR = joinpath(@__DIR__, "..", "src", "tools")
# ------------------------------------------------------------------ #
registry_tools = getTools()
@test !isempty(registry_tools)
@test any(t -> t.name == "getTime", registry_tools)
@test any(t -> t.name == "getWeather", registry_tools)
@test "getTime" in keys(registry_tools)
@test "getWeather" in keys(registry_tools)
# listTools is auto-registered via __init__() → first key, then tools loaded alphabetically
@test collect(keys(registry_tools))[1] == "listTools"
@test collect(keys(registry_tools))[2] == "getTime"
@test collect(keys(registry_tools))[3] == "getWeather"
@test collect(keys(registry_tools))[4] == "writeTool"
clearTools()
@test isempty(getTools())
@@ -121,9 +126,9 @@ TOOLS_DIR = joinpath(@__DIR__, "..", "src", "tools")
)
registerTool(test_tool)
reg = getTools()
@test any(t -> t.name == "manualTool", reg)
@test count(t -> t.name == "manualTool", reg) == 1
@test reg[1].parallelToolExecute == true
@test haskey(reg, "manualTool")
@test length(reg) == 1
@test reg["manualTool"].parallelToolExecute == true
# ------------------------------------------------------------------ #
# 8. getTools returns deep copy (mutations don't affect registry) #