Remove paneTitle

This commit is contained in:
Daniel Harvey 2020-02-22 11:27:28 +00:00
parent 75b65acd09
commit 8e4d38ffa5
8 changed files with 21 additions and 35 deletions

View File

@ -28,7 +28,6 @@ library:
- process
- text
- dhall
- validation
executables:
tmux-mate-exe:

View File

@ -43,19 +43,19 @@ testSession =
[ Window
{ windowTitle = WindowName "first-window",
windowPanes =
[ Pane (PaneCommand "yes 'Pane 1'") (PaneTitle "One"),
Pane (PaneCommand "yes 'Pane 2'") (PaneTitle "Two"),
Pane (PaneCommand "yes 'Pane 3'") (PaneTitle "Three"),
Pane (PaneCommand "yes 'Pane 4'") (PaneTitle "Four")
[ Pane (PaneCommand "yes 'Pane 1'"),
Pane (PaneCommand "yes 'Pane 2'"),
Pane (PaneCommand "yes 'Pane 3'"),
Pane (PaneCommand "yes 'Pane 4'")
]
},
Window
{ windowTitle = WindowName "second-window",
windowPanes =
[ Pane (PaneCommand "yes 'Second Window - Pane 1'") (PaneTitle "2One"),
Pane (PaneCommand "yes 'Second Window - Pane 2'") (PaneTitle "2Two"),
Pane (PaneCommand "yes 'Second Window - Pane 3'") (PaneTitle "2Three"),
Pane (PaneCommand "yes 'Second Window - Pane 4'") (PaneTitle "2Four")
[ Pane (PaneCommand "yes 'Second Window - Pane 1'"),
Pane (PaneCommand "yes 'Second Window - Pane 2'"),
Pane (PaneCommand "yes 'Second Window - Pane 3'"),
Pane (PaneCommand "yes 'Second Window - Pane 4'")
]
}
]

View File

@ -45,15 +45,9 @@ newtype PaneCommand
deriving stock (Eq, Ord, Generic)
deriving newtype (Show, ToDhall, FromDhall)
newtype PaneTitle
= PaneTitle {getPaneTitle :: String}
deriving stock (Eq, Ord, Generic)
deriving newtype (Show, ToDhall, FromDhall)
data Pane
= Pane
{ paneCommand :: PaneCommand,
paneTitle :: PaneTitle
{ paneCommand :: PaneCommand
}
deriving (Eq, Ord, Show, Generic, FromDhall, ToDhall)

View File

@ -79,7 +79,7 @@ spec = do
[]
( VWindow
(VWindowName (NE.fromList "window"))
$ NE.fromList [Pane (PaneCommand "go") undefined]
$ NE.fromList [Pane (PaneCommand "go")]
)
`shouldBe` [ CreatePane
(VSessionName $ NE.fromList "horses")
@ -97,7 +97,7 @@ spec = do
]
( VWindow
(VWindowName (NE.fromList "window"))
$ NE.fromList [Pane (PaneCommand "go") undefined]
$ NE.fromList [Pane (PaneCommand "go")]
)
`shouldBe` [ CreatePane
(VSessionName $ NE.fromList "horses")
@ -115,7 +115,7 @@ spec = do
]
( VWindow
(VWindowName (NE.fromList "window"))
$ NE.fromList [Pane (PaneCommand "go") undefined]
$ NE.fromList [Pane (PaneCommand "go")]
)
`shouldBe` []
describe "removeWindowPanes" $ do
@ -126,7 +126,7 @@ spec = do
( NE.fromList
[ ( VWindow
(VWindowName (NE.fromList "window"))
$ NE.fromList [Pane (PaneCommand "go") undefined]
$ NE.fromList [Pane (PaneCommand "go")]
)
]
)
@ -143,7 +143,7 @@ spec = do
( NE.fromList
[ ( VWindow
(VWindowName (NE.fromList "window"))
$ NE.fromList [Pane (PaneCommand "go") undefined]
$ NE.fromList [Pane (PaneCommand "go")]
)
]
)
@ -160,7 +160,7 @@ spec = do
( NE.fromList
[ ( VWindow
(VWindowName (NE.fromList "window"))
$ NE.fromList [Pane (PaneCommand "whoa-no") undefined]
$ NE.fromList [Pane (PaneCommand "whoa-no")]
)
]
)
@ -173,7 +173,7 @@ spec = do
( NE.fromList
[ ( VWindow
(VWindowName (NE.fromList "window"))
$ NE.fromList [Pane (PaneCommand "go") undefined]
$ NE.fromList [Pane (PaneCommand "go")]
)
]
)
@ -191,7 +191,7 @@ spec = do
[ ( VWindow
(VWindowName (NE.fromList "window"))
$ NE.fromList
[Pane (PaneCommand "go") undefined]
[Pane (PaneCommand "go")]
)
]
)

View File

@ -41,8 +41,5 @@ instance Arbitrary SessionName where
instance Arbitrary Pane where
arbitrary = genericArbitrary
instance Arbitrary PaneTitle where
arbitrary = oneof [pure (PaneTitle "pane-title")]
instance Arbitrary PaneCommand where
arbitrary = oneof [pure (PaneCommand "pane-command")]

View File

@ -21,7 +21,7 @@ spec = do
sessionWindows =
[ Window
{ windowTitle = WindowName "OK",
windowPanes = [Pane {paneCommand = PaneCommand "", paneTitle = PaneTitle ""}]
windowPanes = [Pane {paneCommand = PaneCommand ""}]
}
]
}
@ -40,7 +40,7 @@ spec = do
sessionWindows =
[ Window
{ windowTitle = WindowName "",
windowPanes = [Pane {paneCommand = PaneCommand "", paneTitle = PaneTitle ""}]
windowPanes = [Pane {paneCommand = PaneCommand ""}]
}
]
}

View File

@ -1,6 +1,4 @@
{ sessionTitle = "foo"
, sessionPanes =
[ { paneCommand = "yes 'Pane 1'", paneTitle = "One" }
, { paneCommand = "yes 'Pane 2'", paneTitle = "Two" }
]
[ { paneCommand = "yes 'Pane 1'" }, { paneCommand = "yes 'Pane 2'" } ]
}

View File

@ -2,7 +2,5 @@
let sample1 = ./Sample1.dhall
in { sessionTitle = sample1.sessionTitle
, sessionPanes =
sample1.sessionPanes
# [ { paneCommand = "yes 'Pane 3'", paneTitle = "Three" } ]
, sessionPanes = sample1.sessionPanes # [ { paneCommand = "yes 'Pane 3'" } ]
}