summaryrefslogtreecommitdiff
path: root/Omni/Agent
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-11-22 13:53:49 -0500
committerBen Sima <ben@bensima.com>2025-11-22 13:53:49 -0500
commit8697fd8a11a1cf368db1e6c05afddf87906e8de3 (patch)
treef6d5e8804c563435ff4b1e9f046c74c6b837c764 /Omni/Agent
parentd7474f376f55bbd7d7f047551b50f840bc91526d (diff)
parenta21633e61be70e1fa5ffec24267f1bf18f5497ad (diff)
task: complete t-rWcqsDZFM.1 (Merge)
Amp-Thread-ID: https://ampcode.com/threads/T-ca3b086b-5a85-422a-b13d-256784c04221 Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'Omni/Agent')
-rw-r--r--Omni/Agent/LogTest.hs74
1 files changed, 0 insertions, 74 deletions
diff --git a/Omni/Agent/LogTest.hs b/Omni/Agent/LogTest.hs
deleted file mode 100644
index 97b558d..0000000
--- a/Omni/Agent/LogTest.hs
+++ /dev/null
@@ -1,74 +0,0 @@
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-
--- : out agent-log-test
-module Omni.Agent.LogTest where
-
-import Alpha
-import Omni.Agent.Log
-import qualified Omni.Test as Test
-
-main :: IO ()
-main = Test.run tests
-
-tests :: Test.Tree
-tests =
- Test.group
- "Omni.Agent.Log"
- [ Test.unit "Parse LogEntry" testParse,
- Test.unit "Format LogEntry" testFormat
- ]
-
-testParse :: IO ()
-testParse = do
- let json = "{\"message\": \"executing 1 tools in 1 batch(es)\", \"batches\": [[\"grep\"]]}"
- let expected =
- LogEntry
- { leMessage = Just "executing 1 tools in 1 batch(es)",
- leLevel = Nothing,
- leToolName = Nothing,
- leBatches = Just [["grep"]],
- leMethod = Nothing,
- lePath = Nothing
- }
- parseLine json @?= Just expected
-
-testFormat :: IO ()
-testFormat = do
- let entry =
- LogEntry
- { leMessage = Just "executing 1 tools in 1 batch(es)",
- leLevel = Nothing,
- leToolName = Nothing,
- leBatches = Just [["grep"]],
- leMethod = Nothing,
- lePath = Nothing
- }
- -- Expect NO emoji
- formatLogEntry entry @?= Just "THOUGHT: Planning tool execution (grep)"
-
- let entry2 =
- LogEntry
- { leMessage = Just "some random log",
- leLevel = Nothing,
- leToolName = Nothing,
- leBatches = Nothing,
- leMethod = Nothing,
- lePath = Nothing
- }
- formatLogEntry entry2 @?= Nothing
-
- let entry3 =
- LogEntry
- { leMessage = Just "some error",
- leLevel = Just "error",
- leToolName = Nothing,
- leBatches = Nothing,
- leMethod = Nothing,
- lePath = Nothing
- }
- -- Expect NO emoji
- formatLogEntry entry3 @?= Just "ERROR: some error"
-
-(@?=) :: (Eq a, Show a) => a -> a -> IO ()
-(@?=) = (Test.@?=)