Skip to content

Commit

Permalink
== variant without arguments test +
Browse files Browse the repository at this point in the history
  • Loading branch information
lue-bird committed Jul 21, 2023
1 parent 771c96e commit 7add9f2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/EqualsCaseableTest.elm
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ a =
"""
|> Review.Test.run (forbid EqualsCaseable.InIf)
|> Review.Test.expectNoErrors
, test "should report if == []" <|
, test "should report if == Variant" <|
\() ->
"""module A exposing (..)
a =
if list == [] then
"empty"
if choice == Variant then
"variant"
else
"filled"
"not variant"
"""
|> Review.Test.run (forbid EqualsCaseable.Everywhere)
|> Review.Test.expectErrors
Expand All @@ -52,17 +52,17 @@ a =
, "You can replace this check with a `case of` where you use the value you're matching for as a pattern."
, "This can aid structuring your code in a way where the compiler knows as much about the current branch as you. Read more in the readme: https://dark.elm.dmy.fr/packages/lue-bird/elm-review-equals-caseable/latest/"
]
, under = "list == []"
, under = "choice == Variant"
}
|> Review.Test.whenFixed
"""module A exposing (..)
a =
case list of
[] ->
"empty"
case choice of
Variant ->
"variant"
_ ->
"filled"
"not variant"
"""
]
, test "should report if /= []" <|
Expand Down

0 comments on commit 7add9f2

Please sign in to comment.