-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
When working with Arrays, I often find myself needing to use write expectations for them in tests. Unfortunately, while Expect.equalLists exists (and the same for Set/Dict), Expect.equalArrays doesn't. Therefore I often end up needing to write something like this:
some operation
|> Array.toList
|> Expect.equalLists [ ... ]Adding a expectArrays : Array a -> Array a -> Expectation function would forego the need for the manual and maybe confusing conversion.
What I'm unsure of, is whether there should also be a function that—for convenience's sake—takes a List a for the expected collection.
expect??? : List a -> Array a -> Expectation
--
some operation
|> Expect.equal??? [ 1, 2, 3 ]
-- instead of
some operation
|> Expect.equal??? (Array.fromList [ 1, 2, 3 ])
-- or
some operation
|> Array.toList
|> Expect.equalLists [ 1, 2, 3 ]This could be beneficial for equalSets and equalDicts as well.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels