Skip to content

Commit

Permalink
fixup! [#15] Add lenses for config-related types
Browse files Browse the repository at this point in the history
  • Loading branch information
nalkuatov committed Jul 5, 2022
1 parent 45a5fda commit 1e2e06e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/tests/Test/Lens.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,18 @@ test_makeLenses = testGroup "Lenses produced by 'makeLenses' work as expected"
@?= (100, "Hundred")

, testCase "(%~) operator works" do
pair & (firstL %~ (+ 1)) & (secondL %~ (<> " and one"))
(pair & firstL %~ (+ 1) & secondL %~ (<> " and one"))
@?= Pair 101 "Hundred and one"

, testCase "(.~) operator works" do
pair & (firstL .~ 102) & (secondL .~ "Hundred and two")
(pair & firstL .~ 102 & secondL .~ "Hundred and two")
@?= Pair 102 "Hundred and two"

, testCase "(?~) operator works" do
single & (valueL ?~ "Some value")
(single & (valueL ?~ "Some value"))
@?= Single (Just "Some value")
]
]
where
a & f = f a
pair = Pair 100 "Hundred"
single = Single Nothing

0 comments on commit 1e2e06e

Please sign in to comment.