<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="313226" data-post-id="313226">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="LostKobrakai" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/LostKobrakai/120/3072_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  LostKobrakai
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Yeah, should be doable with sourceror, given the following plain elixir poc:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">"""
defmodule MyApp.Test do
  test "abc" do
    y = 15
    assert %{a: ^y, b: 8} = call()
  end
end
"""
|&gt; Code.string_to_quoted!(
  literal_encoder: &amp;{:ok, {:__block__, &amp;2, [&amp;1]}},
  token_metadata: true,
  unescape: false
)
|&gt; Macro.postwalk(fn
  {:assert, assert_meta, [{:=, assign_meta, [{:%{}, _, pairs}, call]}]} -&gt;
    checks =
      Enum.map(pairs, fn {{:__block__, _meta, [key]}, value} -&gt;
        quote do
          assert unquote(value) = response.unquote(key)
        end
      end)

    {:__block__, [],
     [
       {:assert, assert_meta, [{:=, assign_meta, [Macro.var(:response, nil), call]}]} | checks
     ]}

  other -&gt;
    other
end)
|&gt; Code.quoted_to_algebra(
  literal_encoder: &amp;{:ok, {:__block__, &amp;2, [&amp;1]}},
  token_metadata: true,
  unescape: false
)
|&gt; Inspect.Algebra.format(:infinity)
|&gt; IO.iodata_to_binary()
|&gt; IO.puts()
# defmodule MyApp.Test do
#   test "abc" do
#     y = 15
#     (assert response = call()
#     assert ^y = response.a
#     assert 8 = response.b)
#   end
# end
</code></pre>
<p>Not sure how to best get rid of the parenthesis for the block there though.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="313226" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/am-i-the-only-one-who-cant-spot-the-difference-in-map-keys/60738/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-313226" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="313226"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="313228" data-post-id="313228">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sodapopcan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/120/34668_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sodapopcan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Whoa, cool!  I would have not been able to throw that together so quickly <img src="https://forum.elixirforum.com/images/emoji/apple/sweat_smile.png?v=15" title=":sweat_smile:" class="emoji" alt=":sweat_smile:" loading="lazy" width="20" height="20">  Sourceror should take care of the parens, no?  Not actually sure.  I guess not because we’re writing new code <img src="https://forum.elixirforum.com/images/emoji/apple/thinking.png?v=15" title=":thinking:" class="emoji" alt=":thinking:" loading="lazy" width="20" height="20"> Removing them manually wouldn’t be the biggest deal considering the time-savings of code-rewriting (though I shouldn’t say that as it’s not my project we’re talking about).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="313228" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/am-i-the-only-one-who-cant-spot-the-difference-in-map-keys/60738/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-313228" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="313228"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="313231" data-post-id="313231">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dkuku" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dkuku/120/15613_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dkuku
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I love side projects but it feels like the discussion moves a bit off topic <img src="https://forum.elixirforum.com/images/emoji/apple/smiley.png?v=15" title=":smiley:" class="emoji" alt=":smiley:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="313231" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/am-i-the-only-one-who-cant-spot-the-difference-in-map-keys/60738/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-313231" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="313231"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="313234" data-post-id="313234">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sodapopcan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/120/34668_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sodapopcan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I only pushed it because this is how I solved this problem for myself.  I was still learning at the time so I had a tiny project and didn’t need to do any programatic code-rewriting, but I started writing single assertions per key for this very reason.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="313234" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/am-i-the-only-one-who-cant-spot-the-difference-in-map-keys/60738/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-313234" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="313234"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="313237" data-post-id="313237">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dkuku" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dkuku/120/15613_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dkuku
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I just tried latest elixir and the error is different but even more confusing:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule TestMap do
  def a(%{pies: pies, kot: kot, mysz: mysz, slon: slon, zyrafa: zyrafa, zaba: zaba, ryba: ryba, kogut: kogut}), do: :a
  def a(%{pies: pies, kot: kot, mysz: mysz, slon: slon, zyrafa: zyrafa, zaba: zaba, ryba: ryba, kura: kura}), do: :a
  def b() do
  a(%{pies: :pies, kot: :kot, mysz: :mysz, slon: :slon, zyrafa: :zyrafa, zaba: :zaba, ryba: :ryba, kon: :kura})
  end
end
</code></pre>
<pre data-code-wrap="elixir"><code class="lang-elixir">** (FunctionClauseError) no function clause matching in TestMap.a/1    
    
    The following arguments were given to TestMap.a/1:
    
        # 1
        %{pies: :pies, kot: :kot, mysz: :mysz, slon: :slon, zyrafa: :zyrafa, zaba: :zaba, ryba: :ryba, kon: :kura}
    
    map.ex:2: TestMap.a/1
    map.ex:8: (file)
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="313237" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/am-i-the-only-one-who-cant-spot-the-difference-in-map-keys/60738/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-313237" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="313237"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="313238" data-post-id="313238">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="cevado" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cevado/120/40655_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  cevado
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>but you don’t need to refactor everything at once, next time a test breaks, refactor that specific test. spread the word at the company, so they stop doing the old way and more people help to do the refactor… one day it all gonna be done. <img src="https://forum.elixirforum.com/images/emoji/apple/smile.png?v=15" title=":smile:" class="emoji" alt=":smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="313238" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/am-i-the-only-one-who-cant-spot-the-difference-in-map-keys/60738/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-313238" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="313238"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>