From bf01e81971f965262c4689fbb7e79e71a85915fc Mon Sep 17 00:00:00 2001 From: Leonardo Taglialegne Date: Sat, 30 Nov 2024 19:55:09 +0100 Subject: [PATCH] Check type qualification for `Arg.customWithType` patterns --- tests/Pattern.elm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/Pattern.elm b/tests/Pattern.elm index 47f2793..4006b42 100644 --- a/tests/Pattern.elm +++ b/tests/Pattern.elm @@ -191,6 +191,21 @@ suite = """ \\(From.Here.Variant 'c') -> "There is 1 item" """ + , test "custom type helpers - type qualification" <| + \() -> + Elm.Expect.declarationAs + (Elm.declaration "fn" <| + Elm.fn + (Arg.customTypeWith { importFrom = [ "From", "Here" ], variantName = "Variant", typeName = "SomeType" } identity + |> Arg.item (Arg.char 'c') + ) + (\_ -> Elm.string "There is 1 item") + ) + """ + fn : From.Here.SomeType -> String + fn (From.Here.Variant 'c') = + "There is 1 item" + """ , describe "literal patterns" [ test "unit" <| \() ->