mirror of
https://github.com/jtdaugherty/brick.git
synced 2024-09-11 15:55:54 +03:00
Merge pull request #230 from frasertweedale/test/list-initial-selection
Add test for List initial selection
This commit is contained in:
commit
5c1596db00
@ -98,6 +98,13 @@ applyListOps
|
||||
=> (op a -> List n a -> List n a) -> t (op a) -> List n a -> List n a
|
||||
applyListOps f = appEndo . foldMap (Endo . f)
|
||||
|
||||
|
||||
-- | Initial selection is always 0 (or Nothing for empty list)
|
||||
prop_initialSelection :: [a] -> Bool
|
||||
prop_initialSelection xs =
|
||||
list () (V.fromList xs) 1 ^. listSelectedL ==
|
||||
if null xs then Nothing else Just 0
|
||||
|
||||
-- list operations keep the selected index in bounds
|
||||
prop_listOpsMaintainSelectedValid
|
||||
:: (Eq a) => [ListOp a] -> List n a -> Bool
|
||||
|
Loading…
Reference in New Issue
Block a user