Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core): Use kv based context to avoid allocations #4986

Merged
merged 2 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions bindings/haskell/test/BasicTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ basicTests =
"Basic Tests"
[ testCase "testBasicOperation" testRawOperation,
testCase "testMonad" testMonad,
testCase "testError" testError,
testCase "testLogger" testLogger
testCase "testError" testError
]

testRawOperation :: Assertion
Expand Down Expand Up @@ -102,15 +101,6 @@ testError = do
where
operation = readOp "non-exist-path"

testLogger :: Assertion
testLogger = do
state <- newIORef ""
let logger initStr msg = modifyIORef' initStr (<> msgText msg)
let logFn = LogAction $ logger state
Right _ <- newOperator "memory" {ocLogAction = Just logFn}
logStr <- readIORef state
T.take 78 logStr @?= "service=memory operation=metadata -> startedservice=memory operation=metadata"

-- helper function

(?=) :: (MonadIO m, Eq a, Show a) => m a -> a -> m ()
Expand Down
Loading
Loading