# Scannable map or struct assertions

**URL:** <https://forum.elixirforum.com/t/scannable-map-or-struct-assertions/27747>\
**Category:** Discussions\
**Tags:** testing, assertions\
**Created:** [December 22, 2019, 8:43pm UTC](https://forum.elixirforum.com/t/scannable-map-or-struct-assertions/27747 "2019-12-22T20:43:25Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![hauleth](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hauleth/32/18942_2.png) [@hauleth](https://forum.elixirforum.com/u/hauleth)\
**Post date:** [December 23, 2019, 10:51am UTC](https://forum.elixirforum.com/t/scannable-map-or-struct-assertions/27747/9 "2019-12-23T10:51:56Z")

</div>

> [@marick](#):
>
> I’d rather combine the two:
> 
> ```elixir
> assert %{
> name: "Bossy",
> tags: &Enum.empty?/1
> } = bossify("Bossy")
> 
> ```

This has completely different meaning as:

```elixir
map = %{
  name: "Bossy",
  tags: &Enum.empty/1
}

assert %{
    name: "Bossy",
    tags: &Enum.empty/1
  } = map

```

Would fail. This would be irritating even more, at least for me.

I like simplicity of current mappings and the fact that these allows me to compose them easily. I never had problems with remembering that few assignments left.

However as @devonestes said, the `assert_copy` seems interesting though.

---

_[View the full topic](https://forum.elixirforum.com/t/scannable-map-or-struct-assertions/27747)._
