Skip to content

Commit 2080f06

Browse files
committed
test: about incomplete struct pattern
1 parent 646747c commit 2080f06

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/assert_match_test.exs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ defmodule AssertMatchTest do
3030
assert_match([1, 2], [_ | _])
3131
end
3232

33+
test "should work with incomplete struct patterns" do
34+
# As a value, %Date{year: 2018} raises since [:month, :day] are also enforced.
35+
assert_match(~D[2018-01-01], %Date{year: 2018})
36+
end
37+
3338
test "should work with bindings" do
3439
assert_match(1, int)
3540
assert_match("prefix match", "prefix" <> rest)

0 commit comments

Comments
 (0)