module Ribosome.Test.EmbedTmux where

import Polysemy.Test (UnitTest)

import Ribosome.Embed (HandlerEffects, interpretPluginEmbed)
import Ribosome.Host.Data.RpcHandler (RpcHandler)
import Ribosome.Host.Interpreter.Handlers (withHandlers)
import Ribosome.Test.Data.TestConfig (TmuxTestConfig)
import Ribosome.Test.Embed (TestEffects, testPluginEmbed)
import Ribosome.Test.TmuxCommon (TmuxStack, runTmuxNvim)

type HandlerStack =
  HandlerEffects ++ TmuxStack

type EmbedTmuxWith r =
  TestEffects ++ r ++ HandlerStack

type EmbedTmux =
  EmbedTmuxWith '[]

runEmbedTmuxTestConf ::
  HasCallStack =>
  TmuxTestConfig ->
  Sem HandlerStack () ->
  UnitTest
runEmbedTmuxTestConf :: HasCallStack => TmuxTestConfig -> Sem HandlerStack () -> UnitTest
runEmbedTmuxTestConf TmuxTestConfig
conf =
  HasCallStack => TmuxTestConfig -> Sem TmuxStack () -> UnitTest
TmuxTestConfig -> Sem TmuxStack () -> UnitTest
runTmuxNvim TmuxTestConfig
conf (Sem
   '[NativeTmux, NativeTmux, Resumable TmuxError NativeTmux,
     Resumable CodecError (NativeCodec TmuxCommand),
     Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
     Stop CodecError, Error CodecError, Stop RenderError,
     Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
     Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
     Reader LogConfig, Reader HostConfig, Time Time Date, Log,
     Mask Restoration, Mask Restoration, GatesIO, Race, Async,
     Error BootError, Test, Fail, Error TestError, Hedgehog IO,
     Error Failure, Embed IO, Resource, Final IO]
   ()
 -> UnitTest)
-> (Sem
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Resumable Report Handlers, Log,
        DataLog LogReport, Resumable RpcError Rpc,
        Resumable RpcError (Responses RequestId Response),
        Events (OutChan Event) Event,
        PScoped () (EventChan Event) (Consume Event), Reports,
        Events (OutChan RpcMessage) RpcMessage,
        PScoped () (EventChan RpcMessage) (Consume RpcMessage),
        Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
        NativeTmux, Resumable TmuxError NativeTmux,
        Resumable CodecError (NativeCodec TmuxCommand),
        Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
        Stop CodecError, Error CodecError, Stop RenderError,
        Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
        Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
        Reader LogConfig, Reader HostConfig, Time Time Date, Log,
        Mask Restoration, Mask Restoration, GatesIO, Race, Async,
        Error BootError, Test, Fail, Error TestError, Hedgehog IO,
        Error Failure, Embed IO, Resource, Final IO]
      ()
    -> Sem
         '[NativeTmux, NativeTmux, Resumable TmuxError NativeTmux,
           Resumable CodecError (NativeCodec TmuxCommand),
           Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
           Stop CodecError, Error CodecError, Stop RenderError,
           Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
           Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
           Reader LogConfig, Reader HostConfig, Time Time Date, Log,
           Mask Restoration, Mask Restoration, GatesIO, Race, Async,
           Error BootError, Test, Fail, Error TestError, Hedgehog IO,
           Error Failure, Embed IO, Resource, Final IO]
         ())
-> Sem
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Resumable Report Handlers, Log,
       DataLog LogReport, Resumable RpcError Rpc,
       Resumable RpcError (Responses RequestId Response),
       Events (OutChan Event) Event,
       PScoped () (EventChan Event) (Consume Event), Reports,
       Events (OutChan RpcMessage) RpcMessage,
       PScoped () (EventChan RpcMessage) (Consume RpcMessage),
       Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
       NativeTmux, Resumable TmuxError NativeTmux,
       Resumable CodecError (NativeCodec TmuxCommand),
       Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
       Stop CodecError, Error CodecError, Stop RenderError,
       Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
       Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
       Reader LogConfig, Reader HostConfig, Time Time Date, Log,
       Mask Restoration, Mask Restoration, GatesIO, Race, Async,
       Error BootError, Test, Fail, Error TestError, Hedgehog IO,
       Error Failure, Embed IO, Resource, Final IO]
     ()
-> UnitTest
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  Sem
  '[Resumable RpcError Scratch, Resumable SettingError Settings,
    Resumable Report VariableWatcher, Resumable Report Handlers, Log,
    DataLog LogReport, Resumable RpcError Rpc,
    Resumable RpcError (Responses RequestId Response),
    Events (OutChan Event) Event,
    PScoped () (EventChan Event) (Consume Event), Reports,
    Events (OutChan RpcMessage) RpcMessage,
    PScoped () (EventChan RpcMessage) (Consume RpcMessage),
    Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
    NativeTmux, Resumable TmuxError NativeTmux,
    Resumable CodecError (NativeCodec TmuxCommand),
    Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
    Stop CodecError, Error CodecError, Stop RenderError,
    Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
    Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
    Reader LogConfig, Reader HostConfig, Time Time Date, Log,
    Mask Restoration, Mask Restoration, GatesIO, Race, Async,
    Error BootError, Test, Fail, Error TestError, Hedgehog IO,
    Error Failure, Embed IO, Resource, Final IO]
  ()
-> Sem
     '[NativeTmux, NativeTmux, Resumable TmuxError NativeTmux,
       Resumable CodecError (NativeCodec TmuxCommand),
       Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
       Stop CodecError, Error CodecError, Stop RenderError,
       Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
       Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
       Reader LogConfig, Reader HostConfig, Time Time Date, Log,
       Mask Restoration, Mask Restoration, GatesIO, Race, Async,
       Error BootError, Test, Fail, Error TestError, Hedgehog IO,
       Error Failure, Embed IO, Resource, Final IO]
     ()
forall (r :: [(* -> *) -> * -> *]).
(Members '[Log, Reader LogConfig, Reader PluginName] r,
 Members IOStack r) =>
InterpretersFor HandlerEffects r
interpretPluginEmbed

runEmbedTmuxTest ::
  HasCallStack =>
  Sem HandlerStack () ->
  UnitTest
runEmbedTmuxTest :: HasCallStack => Sem HandlerStack () -> UnitTest
runEmbedTmuxTest =
  HasCallStack => TmuxTestConfig -> Sem HandlerStack () -> UnitTest
TmuxTestConfig -> Sem HandlerStack () -> UnitTest
runEmbedTmuxTestConf TmuxTestConfig
forall a. Default a => a
def

runEmbedTmuxGuiTest ::
  HasCallStack =>
  Sem HandlerStack () ->
  UnitTest
runEmbedTmuxGuiTest :: HasCallStack => Sem HandlerStack () -> UnitTest
runEmbedTmuxGuiTest =
  HasCallStack => TmuxTestConfig -> Sem HandlerStack () -> UnitTest
TmuxTestConfig -> Sem HandlerStack () -> UnitTest
runEmbedTmuxTestConf (TmuxTestConfig
forall a. Default a => a
def TmuxTestConfig
-> (TmuxTestConfig -> TmuxTestConfig) -> TmuxTestConfig
forall a b. a -> (a -> b) -> b
& IsLabel
  "tmux"
  ((TmuxTestConfig -> Identity TmuxTestConfig)
   -> TmuxTestConfig -> Identity TmuxTestConfig)
(TmuxTestConfig -> Identity TmuxTestConfig)
-> TmuxTestConfig -> Identity TmuxTestConfig
#tmux ((TmuxTestConfig -> Identity TmuxTestConfig)
 -> TmuxTestConfig -> Identity TmuxTestConfig)
-> ((Bool -> Identity Bool)
    -> TmuxTestConfig -> Identity TmuxTestConfig)
-> (Bool -> Identity Bool)
-> TmuxTestConfig
-> Identity TmuxTestConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IsLabel
  "gui"
  ((Bool -> Identity Bool)
   -> TmuxTestConfig -> Identity TmuxTestConfig)
(Bool -> Identity Bool)
-> TmuxTestConfig -> Identity TmuxTestConfig
#gui ((Bool -> Identity Bool)
 -> TmuxTestConfig -> Identity TmuxTestConfig)
-> Bool -> TmuxTestConfig -> TmuxTestConfig
forall s t a b. ASetter s t a b -> b -> s -> t
.~ Bool
True)

testPluginEmbedTmuxConf ::
   r .
  HasCallStack =>
  Members HandlerStack (r ++ HandlerStack) =>
  TmuxTestConfig ->
  InterpretersFor r HandlerStack ->
  [RpcHandler (r ++ HandlerStack)] ->
  Sem (EmbedTmuxWith r) () ->
  UnitTest
testPluginEmbedTmuxConf :: forall (r :: [(* -> *) -> * -> *]).
(HasCallStack, Members HandlerStack (r ++ HandlerStack)) =>
TmuxTestConfig
-> InterpretersFor r HandlerStack
-> [RpcHandler (r ++ HandlerStack)]
-> Sem (EmbedTmuxWith r) ()
-> UnitTest
testPluginEmbedTmuxConf TmuxTestConfig
conf InterpretersFor r HandlerStack
effs [RpcHandler (r ++ HandlerStack)]
handlers =
  HasCallStack => TmuxTestConfig -> Sem HandlerStack () -> UnitTest
TmuxTestConfig -> Sem HandlerStack () -> UnitTest
runEmbedTmuxTestConf TmuxTestConfig
conf (Sem
   '[Resumable RpcError Scratch, Resumable SettingError Settings,
     Resumable Report VariableWatcher, Resumable Report Handlers, Log,
     DataLog LogReport, Resumable RpcError Rpc,
     Resumable RpcError (Responses RequestId Response),
     Events (OutChan Event) Event,
     PScoped () (EventChan Event) (Consume Event), Reports,
     Events (OutChan RpcMessage) RpcMessage,
     PScoped () (EventChan RpcMessage) (Consume RpcMessage),
     Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
     NativeTmux, Resumable TmuxError NativeTmux,
     Resumable CodecError (NativeCodec TmuxCommand),
     Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
     Stop CodecError, Error CodecError, Stop RenderError,
     Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
     Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
     Reader LogConfig, Reader HostConfig, Time Time Date, Log,
     Mask Restoration, Mask Restoration, GatesIO, Race, Async,
     Error BootError, Test, Fail, Error TestError, Hedgehog IO,
     Error Failure, Embed IO, Resource, Final IO]
   ()
 -> UnitTest)
-> (Sem
      (Stop Report
         : Stop RpcError : Scratch : Settings : Rpc
         : Append
             r
             '[Resumable RpcError Scratch, Resumable SettingError Settings,
               Resumable Report VariableWatcher, Resumable Report Handlers, Log,
               DataLog LogReport, Resumable RpcError Rpc,
               Resumable RpcError (Responses RequestId Response),
               Events (OutChan Event) Event,
               PScoped () (EventChan Event) (Consume Event), Reports,
               Events (OutChan RpcMessage) RpcMessage,
               PScoped () (EventChan RpcMessage) (Consume RpcMessage),
               Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
               NativeTmux, Resumable TmuxError NativeTmux,
               Resumable CodecError (NativeCodec TmuxCommand),
               Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
               Stop CodecError, Error CodecError, Stop RenderError,
               Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
               Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
               Reader LogConfig, Reader HostConfig, Time Time Date, Log,
               Mask Restoration, Mask Restoration, GatesIO, Race, Async,
               Error BootError, Test, Fail, Error TestError, Hedgehog IO,
               Error Failure, Embed IO, Resource, Final IO])
      ()
    -> Sem
         '[Resumable RpcError Scratch, Resumable SettingError Settings,
           Resumable Report VariableWatcher, Resumable Report Handlers, Log,
           DataLog LogReport, Resumable RpcError Rpc,
           Resumable RpcError (Responses RequestId Response),
           Events (OutChan Event) Event,
           PScoped () (EventChan Event) (Consume Event), Reports,
           Events (OutChan RpcMessage) RpcMessage,
           PScoped () (EventChan RpcMessage) (Consume RpcMessage),
           Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
           NativeTmux, Resumable TmuxError NativeTmux,
           Resumable CodecError (NativeCodec TmuxCommand),
           Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
           Stop CodecError, Error CodecError, Stop RenderError,
           Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
           Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
           Reader LogConfig, Reader HostConfig, Time Time Date, Log,
           Mask Restoration, Mask Restoration, GatesIO, Race, Async,
           Error BootError, Test, Fail, Error TestError, Hedgehog IO,
           Error Failure, Embed IO, Resource, Final IO]
         ())
-> Sem
     (Stop Report
        : Stop RpcError : Scratch : Settings : Rpc
        : Append
            r
            '[Resumable RpcError Scratch, Resumable SettingError Settings,
              Resumable Report VariableWatcher, Resumable Report Handlers, Log,
              DataLog LogReport, Resumable RpcError Rpc,
              Resumable RpcError (Responses RequestId Response),
              Events (OutChan Event) Event,
              PScoped () (EventChan Event) (Consume Event), Reports,
              Events (OutChan RpcMessage) RpcMessage,
              PScoped () (EventChan RpcMessage) (Consume RpcMessage),
              Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
              NativeTmux, Resumable TmuxError NativeTmux,
              Resumable CodecError (NativeCodec TmuxCommand),
              Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
              Stop CodecError, Error CodecError, Stop RenderError,
              Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
              Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
              Reader LogConfig, Reader HostConfig, Time Time Date, Log,
              Mask Restoration, Mask Restoration, GatesIO, Race, Async,
              Error BootError, Test, Fail, Error TestError, Hedgehog IO,
              Error Failure, Embed IO, Resource, Final IO])
     ()
-> UnitTest
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  Sem
  (Append
     r
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Resumable Report Handlers, Log,
       DataLog LogReport, Resumable RpcError Rpc,
       Resumable RpcError (Responses RequestId Response),
       Events (OutChan Event) Event,
       PScoped () (EventChan Event) (Consume Event), Reports,
       Events (OutChan RpcMessage) RpcMessage,
       PScoped () (EventChan RpcMessage) (Consume RpcMessage),
       Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
       NativeTmux, Resumable TmuxError NativeTmux,
       Resumable CodecError (NativeCodec TmuxCommand),
       Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
       Stop CodecError, Error CodecError, Stop RenderError,
       Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
       Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
       Reader LogConfig, Reader HostConfig, Time Time Date, Log,
       Mask Restoration, Mask Restoration, GatesIO, Race, Async,
       Error BootError, Test, Fail, Error TestError, Hedgehog IO,
       Error Failure, Embed IO, Resource, Final IO])
  ()
-> Sem
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Resumable Report Handlers, Log,
       DataLog LogReport, Resumable RpcError Rpc,
       Resumable RpcError (Responses RequestId Response),
       Events (OutChan Event) Event,
       PScoped () (EventChan Event) (Consume Event), Reports,
       Events (OutChan RpcMessage) RpcMessage,
       PScoped () (EventChan RpcMessage) (Consume RpcMessage),
       Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
       NativeTmux, Resumable TmuxError NativeTmux,
       Resumable CodecError (NativeCodec TmuxCommand),
       Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
       Stop CodecError, Error CodecError, Stop RenderError,
       Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
       Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
       Reader LogConfig, Reader HostConfig, Time Time Date, Log,
       Mask Restoration, Mask Restoration, GatesIO, Race, Async,
       Error BootError, Test, Fail, Error TestError, Hedgehog IO,
       Error Failure, Embed IO, Resource, Final IO]
     ()
InterpretersFor r HandlerStack
effs (Sem
   (Append
      r
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Resumable Report Handlers, Log,
        DataLog LogReport, Resumable RpcError Rpc,
        Resumable RpcError (Responses RequestId Response),
        Events (OutChan Event) Event,
        PScoped () (EventChan Event) (Consume Event), Reports,
        Events (OutChan RpcMessage) RpcMessage,
        PScoped () (EventChan RpcMessage) (Consume RpcMessage),
        Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
        NativeTmux, Resumable TmuxError NativeTmux,
        Resumable CodecError (NativeCodec TmuxCommand),
        Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
        Stop CodecError, Error CodecError, Stop RenderError,
        Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
        Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
        Reader LogConfig, Reader HostConfig, Time Time Date, Log,
        Mask Restoration, Mask Restoration, GatesIO, Race, Async,
        Error BootError, Test, Fail, Error TestError, Hedgehog IO,
        Error Failure, Embed IO, Resource, Final IO])
   ()
 -> Sem
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Resumable Report Handlers, Log,
        DataLog LogReport, Resumable RpcError Rpc,
        Resumable RpcError (Responses RequestId Response),
        Events (OutChan Event) Event,
        PScoped () (EventChan Event) (Consume Event), Reports,
        Events (OutChan RpcMessage) RpcMessage,
        PScoped () (EventChan RpcMessage) (Consume RpcMessage),
        Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
        NativeTmux, Resumable TmuxError NativeTmux,
        Resumable CodecError (NativeCodec TmuxCommand),
        Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
        Stop CodecError, Error CodecError, Stop RenderError,
        Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
        Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
        Reader LogConfig, Reader HostConfig, Time Time Date, Log,
        Mask Restoration, Mask Restoration, GatesIO, Race, Async,
        Error BootError, Test, Fail, Error TestError, Hedgehog IO,
        Error Failure, Embed IO, Resource, Final IO]
      ())
-> (Sem
      (Stop Report
         : Stop RpcError : Scratch : Settings : Rpc
         : Append
             r
             '[Resumable RpcError Scratch, Resumable SettingError Settings,
               Resumable Report VariableWatcher, Resumable Report Handlers, Log,
               DataLog LogReport, Resumable RpcError Rpc,
               Resumable RpcError (Responses RequestId Response),
               Events (OutChan Event) Event,
               PScoped () (EventChan Event) (Consume Event), Reports,
               Events (OutChan RpcMessage) RpcMessage,
               PScoped () (EventChan RpcMessage) (Consume RpcMessage),
               Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
               NativeTmux, Resumable TmuxError NativeTmux,
               Resumable CodecError (NativeCodec TmuxCommand),
               Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
               Stop CodecError, Error CodecError, Stop RenderError,
               Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
               Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
               Reader LogConfig, Reader HostConfig, Time Time Date, Log,
               Mask Restoration, Mask Restoration, GatesIO, Race, Async,
               Error BootError, Test, Fail, Error TestError, Hedgehog IO,
               Error Failure, Embed IO, Resource, Final IO])
      ()
    -> Sem
         (Append
            r
            '[Resumable RpcError Scratch, Resumable SettingError Settings,
              Resumable Report VariableWatcher, Resumable Report Handlers, Log,
              DataLog LogReport, Resumable RpcError Rpc,
              Resumable RpcError (Responses RequestId Response),
              Events (OutChan Event) Event,
              PScoped () (EventChan Event) (Consume Event), Reports,
              Events (OutChan RpcMessage) RpcMessage,
              PScoped () (EventChan RpcMessage) (Consume RpcMessage),
              Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
              NativeTmux, Resumable TmuxError NativeTmux,
              Resumable CodecError (NativeCodec TmuxCommand),
              Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
              Stop CodecError, Error CodecError, Stop RenderError,
              Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
              Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
              Reader LogConfig, Reader HostConfig, Time Time Date, Log,
              Mask Restoration, Mask Restoration, GatesIO, Race, Async,
              Error BootError, Test, Fail, Error TestError, Hedgehog IO,
              Error Failure, Embed IO, Resource, Final IO])
         ())
-> Sem
     (Stop Report
        : Stop RpcError : Scratch : Settings : Rpc
        : Append
            r
            '[Resumable RpcError Scratch, Resumable SettingError Settings,
              Resumable Report VariableWatcher, Resumable Report Handlers, Log,
              DataLog LogReport, Resumable RpcError Rpc,
              Resumable RpcError (Responses RequestId Response),
              Events (OutChan Event) Event,
              PScoped () (EventChan Event) (Consume Event), Reports,
              Events (OutChan RpcMessage) RpcMessage,
              PScoped () (EventChan RpcMessage) (Consume RpcMessage),
              Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
              NativeTmux, Resumable TmuxError NativeTmux,
              Resumable CodecError (NativeCodec TmuxCommand),
              Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
              Stop CodecError, Error CodecError, Stop RenderError,
              Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
              Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
              Reader LogConfig, Reader HostConfig, Time Time Date, Log,
              Mask Restoration, Mask Restoration, GatesIO, Race, Async,
              Error BootError, Test, Fail, Error TestError, Hedgehog IO,
              Error Failure, Embed IO, Resource, Final IO])
     ()
-> Sem
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Resumable Report Handlers, Log,
       DataLog LogReport, Resumable RpcError Rpc,
       Resumable RpcError (Responses RequestId Response),
       Events (OutChan Event) Event,
       PScoped () (EventChan Event) (Consume Event), Reports,
       Events (OutChan RpcMessage) RpcMessage,
       PScoped () (EventChan RpcMessage) (Consume RpcMessage),
       Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
       NativeTmux, Resumable TmuxError NativeTmux,
       Resumable CodecError (NativeCodec TmuxCommand),
       Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
       Stop CodecError, Error CodecError, Stop RenderError,
       Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
       Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
       Reader LogConfig, Reader HostConfig, Time Time Date, Log,
       Mask Restoration, Mask Restoration, GatesIO, Race, Async,
       Error BootError, Test, Fail, Error TestError, Hedgehog IO,
       Error Failure, Embed IO, Resource, Final IO]
     ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  [RpcHandler
   (Append
      r
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Resumable Report Handlers, Log,
        DataLog LogReport, Resumable RpcError Rpc,
        Resumable RpcError (Responses RequestId Response),
        Events (OutChan Event) Event,
        PScoped () (EventChan Event) (Consume Event), Reports,
        Events (OutChan RpcMessage) RpcMessage,
        PScoped () (EventChan RpcMessage) (Consume RpcMessage),
        Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
        NativeTmux, Resumable TmuxError NativeTmux,
        Resumable CodecError (NativeCodec TmuxCommand),
        Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
        Stop CodecError, Error CodecError, Stop RenderError,
        Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
        Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
        Reader LogConfig, Reader HostConfig, Time Time Date, Log,
        Mask Restoration, Mask Restoration, GatesIO, Race, Async,
        Error BootError, Test, Fail, Error TestError, Hedgehog IO,
        Error Failure, Embed IO, Resource, Final IO])]
-> Sem
     (Append
        r
        '[Resumable RpcError Scratch, Resumable SettingError Settings,
          Resumable Report VariableWatcher, Resumable Report Handlers, Log,
          DataLog LogReport, Resumable RpcError Rpc,
          Resumable RpcError (Responses RequestId Response),
          Events (OutChan Event) Event,
          PScoped () (EventChan Event) (Consume Event), Reports,
          Events (OutChan RpcMessage) RpcMessage,
          PScoped () (EventChan RpcMessage) (Consume RpcMessage),
          Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
          NativeTmux, Resumable TmuxError NativeTmux,
          Resumable CodecError (NativeCodec TmuxCommand),
          Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
          Stop CodecError, Error CodecError, Stop RenderError,
          Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
          Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
          Reader LogConfig, Reader HostConfig, Time Time Date, Log,
          Mask Restoration, Mask Restoration, GatesIO, Race, Async,
          Error BootError, Test, Fail, Error TestError, Hedgehog IO,
          Error Failure, Embed IO, Resource, Final IO])
     ()
-> Sem
     (Append
        r
        '[Resumable RpcError Scratch, Resumable SettingError Settings,
          Resumable Report VariableWatcher, Resumable Report Handlers, Log,
          DataLog LogReport, Resumable RpcError Rpc,
          Resumable RpcError (Responses RequestId Response),
          Events (OutChan Event) Event,
          PScoped () (EventChan Event) (Consume Event), Reports,
          Events (OutChan RpcMessage) RpcMessage,
          PScoped () (EventChan RpcMessage) (Consume RpcMessage),
          Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
          NativeTmux, Resumable TmuxError NativeTmux,
          Resumable CodecError (NativeCodec TmuxCommand),
          Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
          Stop CodecError, Error CodecError, Stop RenderError,
          Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
          Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
          Reader LogConfig, Reader HostConfig, Time Time Date, Log,
          Mask Restoration, Mask Restoration, GatesIO, Race, Async,
          Error BootError, Test, Fail, Error TestError, Hedgehog IO,
          Error Failure, Embed IO, Resource, Final IO])
     ()
forall (r :: [(* -> *) -> * -> *]) a.
Members
  '[Resumable Report Handlers, Resumable RpcError Rpc, Log,
    Error BootError]
  r =>
[RpcHandler r] -> Sem r a -> Sem r a
withHandlers [RpcHandler
   (Append
      r
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Resumable Report Handlers, Log,
        DataLog LogReport, Resumable RpcError Rpc,
        Resumable RpcError (Responses RequestId Response),
        Events (OutChan Event) Event,
        PScoped () (EventChan Event) (Consume Event), Reports,
        Events (OutChan RpcMessage) RpcMessage,
        PScoped () (EventChan RpcMessage) (Consume RpcMessage),
        Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
        NativeTmux, Resumable TmuxError NativeTmux,
        Resumable CodecError (NativeCodec TmuxCommand),
        Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
        Stop CodecError, Error CodecError, Stop RenderError,
        Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
        Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
        Reader LogConfig, Reader HostConfig, Time Time Date, Log,
        Mask Restoration, Mask Restoration, GatesIO, Race, Async,
        Error BootError, Test, Fail, Error TestError, Hedgehog IO,
        Error Failure, Embed IO, Resource, Final IO])]
[RpcHandler (r ++ HandlerStack)]
handlers (Sem
   (Append
      r
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Resumable Report Handlers, Log,
        DataLog LogReport, Resumable RpcError Rpc,
        Resumable RpcError (Responses RequestId Response),
        Events (OutChan Event) Event,
        PScoped () (EventChan Event) (Consume Event), Reports,
        Events (OutChan RpcMessage) RpcMessage,
        PScoped () (EventChan RpcMessage) (Consume RpcMessage),
        Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
        NativeTmux, Resumable TmuxError NativeTmux,
        Resumable CodecError (NativeCodec TmuxCommand),
        Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
        Stop CodecError, Error CodecError, Stop RenderError,
        Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
        Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
        Reader LogConfig, Reader HostConfig, Time Time Date, Log,
        Mask Restoration, Mask Restoration, GatesIO, Race, Async,
        Error BootError, Test, Fail, Error TestError, Hedgehog IO,
        Error Failure, Embed IO, Resource, Final IO])
   ()
 -> Sem
      (Append
         r
         '[Resumable RpcError Scratch, Resumable SettingError Settings,
           Resumable Report VariableWatcher, Resumable Report Handlers, Log,
           DataLog LogReport, Resumable RpcError Rpc,
           Resumable RpcError (Responses RequestId Response),
           Events (OutChan Event) Event,
           PScoped () (EventChan Event) (Consume Event), Reports,
           Events (OutChan RpcMessage) RpcMessage,
           PScoped () (EventChan RpcMessage) (Consume RpcMessage),
           Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
           NativeTmux, Resumable TmuxError NativeTmux,
           Resumable CodecError (NativeCodec TmuxCommand),
           Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
           Stop CodecError, Error CodecError, Stop RenderError,
           Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
           Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
           Reader LogConfig, Reader HostConfig, Time Time Date, Log,
           Mask Restoration, Mask Restoration, GatesIO, Race, Async,
           Error BootError, Test, Fail, Error TestError, Hedgehog IO,
           Error Failure, Embed IO, Resource, Final IO])
      ())
-> (Sem
      (Stop Report
         : Stop RpcError : Scratch : Settings : Rpc
         : Append
             r
             '[Resumable RpcError Scratch, Resumable SettingError Settings,
               Resumable Report VariableWatcher, Resumable Report Handlers, Log,
               DataLog LogReport, Resumable RpcError Rpc,
               Resumable RpcError (Responses RequestId Response),
               Events (OutChan Event) Event,
               PScoped () (EventChan Event) (Consume Event), Reports,
               Events (OutChan RpcMessage) RpcMessage,
               PScoped () (EventChan RpcMessage) (Consume RpcMessage),
               Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
               NativeTmux, Resumable TmuxError NativeTmux,
               Resumable CodecError (NativeCodec TmuxCommand),
               Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
               Stop CodecError, Error CodecError, Stop RenderError,
               Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
               Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
               Reader LogConfig, Reader HostConfig, Time Time Date, Log,
               Mask Restoration, Mask Restoration, GatesIO, Race, Async,
               Error BootError, Test, Fail, Error TestError, Hedgehog IO,
               Error Failure, Embed IO, Resource, Final IO])
      ()
    -> Sem
         (Append
            r
            '[Resumable RpcError Scratch, Resumable SettingError Settings,
              Resumable Report VariableWatcher, Resumable Report Handlers, Log,
              DataLog LogReport, Resumable RpcError Rpc,
              Resumable RpcError (Responses RequestId Response),
              Events (OutChan Event) Event,
              PScoped () (EventChan Event) (Consume Event), Reports,
              Events (OutChan RpcMessage) RpcMessage,
              PScoped () (EventChan RpcMessage) (Consume RpcMessage),
              Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
              NativeTmux, Resumable TmuxError NativeTmux,
              Resumable CodecError (NativeCodec TmuxCommand),
              Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
              Stop CodecError, Error CodecError, Stop RenderError,
              Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
              Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
              Reader LogConfig, Reader HostConfig, Time Time Date, Log,
              Mask Restoration, Mask Restoration, GatesIO, Race, Async,
              Error BootError, Test, Fail, Error TestError, Hedgehog IO,
              Error Failure, Embed IO, Resource, Final IO])
         ())
-> Sem
     (Stop Report
        : Stop RpcError : Scratch : Settings : Rpc
        : Append
            r
            '[Resumable RpcError Scratch, Resumable SettingError Settings,
              Resumable Report VariableWatcher, Resumable Report Handlers, Log,
              DataLog LogReport, Resumable RpcError Rpc,
              Resumable RpcError (Responses RequestId Response),
              Events (OutChan Event) Event,
              PScoped () (EventChan Event) (Consume Event), Reports,
              Events (OutChan RpcMessage) RpcMessage,
              PScoped () (EventChan RpcMessage) (Consume RpcMessage),
              Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
              NativeTmux, Resumable TmuxError NativeTmux,
              Resumable CodecError (NativeCodec TmuxCommand),
              Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
              Stop CodecError, Error CodecError, Stop RenderError,
              Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
              Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
              Reader LogConfig, Reader HostConfig, Time Time Date, Log,
              Mask Restoration, Mask Restoration, GatesIO, Race, Async,
              Error BootError, Test, Fail, Error TestError, Hedgehog IO,
              Error Failure, Embed IO, Resource, Final IO])
     ()
-> Sem
     (Append
        r
        '[Resumable RpcError Scratch, Resumable SettingError Settings,
          Resumable Report VariableWatcher, Resumable Report Handlers, Log,
          DataLog LogReport, Resumable RpcError Rpc,
          Resumable RpcError (Responses RequestId Response),
          Events (OutChan Event) Event,
          PScoped () (EventChan Event) (Consume Event), Reports,
          Events (OutChan RpcMessage) RpcMessage,
          PScoped () (EventChan RpcMessage) (Consume RpcMessage),
          Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
          NativeTmux, Resumable TmuxError NativeTmux,
          Resumable CodecError (NativeCodec TmuxCommand),
          Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
          Stop CodecError, Error CodecError, Stop RenderError,
          Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
          Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
          Reader LogConfig, Reader HostConfig, Time Time Date, Log,
          Mask Restoration, Mask Restoration, GatesIO, Race, Async,
          Error BootError, Test, Fail, Error TestError, Hedgehog IO,
          Error Failure, Embed IO, Resource, Final IO])
     ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  Sem
  (Stop Report
     : Stop RpcError : Scratch : Settings : Rpc
     : Append
         r
         '[Resumable RpcError Scratch, Resumable SettingError Settings,
           Resumable Report VariableWatcher, Resumable Report Handlers, Log,
           DataLog LogReport, Resumable RpcError Rpc,
           Resumable RpcError (Responses RequestId Response),
           Events (OutChan Event) Event,
           PScoped () (EventChan Event) (Consume Event), Reports,
           Events (OutChan RpcMessage) RpcMessage,
           PScoped () (EventChan RpcMessage) (Consume RpcMessage),
           Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
           NativeTmux, Resumable TmuxError NativeTmux,
           Resumable CodecError (NativeCodec TmuxCommand),
           Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
           Stop CodecError, Error CodecError, Stop RenderError,
           Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
           Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
           Reader LogConfig, Reader HostConfig, Time Time Date, Log,
           Mask Restoration, Mask Restoration, GatesIO, Race, Async,
           Error BootError, Test, Fail, Error TestError, Hedgehog IO,
           Error Failure, Embed IO, Resource, Final IO])
  ()
-> Sem
     (Append
        r
        '[Resumable RpcError Scratch, Resumable SettingError Settings,
          Resumable Report VariableWatcher, Resumable Report Handlers, Log,
          DataLog LogReport, Resumable RpcError Rpc,
          Resumable RpcError (Responses RequestId Response),
          Events (OutChan Event) Event,
          PScoped () (EventChan Event) (Consume Event), Reports,
          Events (OutChan RpcMessage) RpcMessage,
          PScoped () (EventChan RpcMessage) (Consume RpcMessage),
          Process RpcMessage (Either Text RpcMessage), UserError, NativeTmux,
          NativeTmux, Resumable TmuxError NativeTmux,
          Resumable CodecError (NativeCodec TmuxCommand),
          Resumable CodecError (NativeCodec (Panes Pane)), Reader TmuxNative,
          Stop CodecError, Error CodecError, Stop RenderError,
          Error RenderError, Stop TmuxError, Error TmuxError, Error Text,
          Reader PluginName, Log, Tagged "stderr" Log, Tagged "file" Log,
          Reader LogConfig, Reader HostConfig, Time Time Date, Log,
          Mask Restoration, Mask Restoration, GatesIO, Race, Async,
          Error BootError, Test, Fail, Error TestError, Hedgehog IO,
          Error Failure, Embed IO, Resource, Final IO])
     ()
forall er (r :: [(* -> *) -> * -> *]).
(Members (HostDeps er) r, Members BuiltinHandlersDeps r,
 Members '[Resumable SettingError Settings, Error TestError] r) =>
InterpretersFor
  '[Stop Report, Stop RpcError, Scratch, Settings, Rpc] r
testPluginEmbed

testPluginEmbedTmux ::
   r .
  HasCallStack =>
  Members HandlerStack (r ++ HandlerStack) =>
  InterpretersFor r HandlerStack ->
  [RpcHandler (r ++ HandlerStack)] ->
  Sem (EmbedTmuxWith r) () ->
  UnitTest
testPluginEmbedTmux :: forall (r :: [(* -> *) -> * -> *]).
(HasCallStack, Members HandlerStack (r ++ HandlerStack)) =>
InterpretersFor r HandlerStack
-> [RpcHandler (r ++ HandlerStack)]
-> Sem (EmbedTmuxWith r) ()
-> UnitTest
testPluginEmbedTmux =
  forall (r :: [(* -> *) -> * -> *]).
(HasCallStack, Members HandlerStack (r ++ HandlerStack)) =>
TmuxTestConfig
-> InterpretersFor r HandlerStack
-> [RpcHandler (r ++ HandlerStack)]
-> Sem (EmbedTmuxWith r) ()
-> UnitTest
testPluginEmbedTmuxConf @r TmuxTestConfig
forall a. Default a => a
def

testPluginEmbedTmux_ ::
  HasCallStack =>
  [RpcHandler HandlerStack] ->
  Sem EmbedTmux () ->
  UnitTest
testPluginEmbedTmux_ :: HasCallStack =>
[RpcHandler HandlerStack] -> Sem EmbedTmux () -> UnitTest
testPluginEmbedTmux_ =
  forall (r :: [(* -> *) -> * -> *]).
(HasCallStack, Members HandlerStack (r ++ HandlerStack)) =>
InterpretersFor r HandlerStack
-> [RpcHandler (r ++ HandlerStack)]
-> Sem (EmbedTmuxWith r) ()
-> UnitTest
testPluginEmbedTmux @'[] forall a. a -> a
InterpretersFor '[] HandlerStack
id

testEmbedTmux ::
  HasCallStack =>
  Sem EmbedTmux () ->
  UnitTest
testEmbedTmux :: HasCallStack => Sem EmbedTmux () -> UnitTest
testEmbedTmux =
  HasCallStack =>
[RpcHandler HandlerStack] -> Sem EmbedTmux () -> UnitTest
[RpcHandler HandlerStack] -> Sem EmbedTmux () -> UnitTest
testPluginEmbedTmux_ [RpcHandler HandlerStack]
forall a. Monoid a => a
mempty