@@ -9,6 +9,7 @@ import Control.Lens (ix, (&), (.~), (^.), (^?))
99import Data.Aeson (ToJSON )
1010import Data.Aeson.Extras (encodeByteString )
1111import Data.Default (def )
12+ import Data.Function (on )
1213import Data.Kind (Type )
1314import Data.Map qualified as Map
1415import Data.Maybe (fromMaybe )
@@ -871,20 +872,20 @@ assertCommandHistory state =
871872 ( \ (idx, expectedCmd) ->
872873 assertCommandEqual
873874 (" command at index " ++ show idx ++ " was incorrect:" )
874- (fromMaybe " " $ state ^? commandHistory . ix idx)
875875 (Text. replace " \n " " " expectedCmd)
876+ (fromMaybe " " $ state ^? commandHistory . ix idx)
876877 )
877878
878879assertCommandEqual :: String -> Text -> Text -> Assertion
879- assertCommandEqual err actual expected
880- | commandEqual actual expected = return ()
880+ assertCommandEqual err expected actual
881+ | commandEqual expected actual = return ()
881882 | otherwise = assertFailure $ err ++ " \n Expected:\n " ++ show expected ++ " \n Got:\n " ++ show actual
882883
883884commandEqual :: Text -> Text -> Bool
884885commandEqual " " " " = True
885886commandEqual " " _ = False
886887commandEqual _ " " = False
887- commandEqual actual expected = maybe False (\ restAct -> commandEqual ( dropToSpace restAct) (dropToSpace postExp) ) mRestAct
888+ commandEqual expected actual = maybe False (on commandEqual dropToSpace postExp) mRestAct
888889 where
889890 (preExp, postExp) = Text. breakOn " ?" expected
890891 mRestAct = Text. stripPrefix preExp actual
0 commit comments