Skip to content

Commit a3ffc74

Browse files
committed
test: add examples for execution limits and statistics handling
1 parent 4d66d57 commit a3ffc74

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/agent_forge/examples_test.exs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,30 @@ defmodule AgentForge.ExamplesTest do
4242
assert output =~ ~r/data: "Job completed with result: \\"Completed\\""/
4343
end
4444
end
45+
46+
describe "limited_workflow.exs" do
47+
test "demonstrates execution limits and statistics" do
48+
output = capture_io(fn -> Code.eval_file("examples/limited_workflow.exs") end)
49+
50+
# Verify basic timeout example
51+
assert output =~ "--- Basic Example with Timeout ---"
52+
assert output =~ ~r/Processing signal: task -> "Sample data"/
53+
assert output =~ ~r/Result: processed -> "Sample data"/
54+
55+
# Verify statistics collection
56+
assert output =~ "--- Example with Statistics Collection ---"
57+
assert output =~ "Validating data..."
58+
assert output =~ "Transforming data..."
59+
assert output =~ "Finalizing..."
60+
assert output =~ ~r/Result: completed -> "Test data \(transformed\)"/
61+
assert output =~ "Execution Statistics:"
62+
63+
# Verify timeout error handling
64+
assert output =~ "--- Example with Timeout Error ---"
65+
assert output =~ "Starting long process..."
66+
assert output =~ "Error handled gracefully: "
67+
assert output =~ "Timeout Statistics:"
68+
assert output =~ "- Completed: true"
69+
end
70+
end
4571
end

0 commit comments

Comments
 (0)