module Pqi.Conformance.Operation.SetErrorVerbosity
( spec,
)
where
import qualified Pqi
import qualified Pqi as Lq
import Pqi.Conformance.Harness
import Pqi.Conformance.Prelude
import Test.Hspec
spec :: Pqi.Adapter -> SpecWith ByteString
spec :: Adapter -> SpecWith ByteString
spec Adapter
adapter =
String -> SpecWith ByteString -> SpecWith ByteString
forall a. HasCallStack => String -> SpecWith a -> SpecWith a
describe String
"setErrorVerbosity" do
String
-> (ByteString -> IO ()) -> SpecWith (Arg (ByteString -> IO ()))
forall a.
(HasCallStack, Example a) =>
String -> a -> SpecWith (Arg a)
it String
"returns the previous setting" \ByteString
conninfo ->
Adapter
-> ByteString
-> (Connection -> IO (Verbosity, Verbosity, Verbosity))
-> IO ()
forall a.
(Eq a, Show a, HasCallStack) =>
Adapter -> ByteString -> (Connection -> IO a) -> IO ()
differential Adapter
adapter ByteString
conninfo \Connection
connection -> do
beforeTerse <- Connection -> Verbosity -> IO Verbosity
Lq.setErrorVerbosity Connection
connection Verbosity
Lq.ErrorsTerse
beforeVerbose <- Lq.setErrorVerbosity connection Lq.ErrorsVerbose
beforeDefault <- Lq.setErrorVerbosity connection Lq.ErrorsDefault
pure (beforeTerse, beforeVerbose, beforeDefault)