<p>It's really the upper and lower boundaries that we want to check, and it's reasonable to assume all the intermediate values will work fine if the boundary values are tested.</p>
<p>This also saves about 75% of the time taken and almost 85% of the assertions when running all the model tests.</p>
<p>Rough notes from my laptop when running <code>bundle exec rails test test/models/</code>:</p>
<p>Before:</p>
<div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="Finished in 21.187886s, 11.1384 runs/s, 314.2362 assertions/s.
236 runs, 6658 assertions, 0 failures, 0 errors, 0 skips
"><pre><code>Finished in 21.187886s, 11.1384 runs/s, 314.2362 assertions/s.
236 runs, 6658 assertions, 0 failures, 0 errors, 0 skips
</code></pre></div>
<p>After:</p>
<div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="Finished in 6.723931s, 35.0985 runs/s, 160.3229 assertions/s.
236 runs, 1078 assertions, 0 failures, 0 errors, 0 skips
"><pre><code>Finished in 6.723931s, 35.0985 runs/s, 160.3229 assertions/s.
236 runs, 1078 assertions, 0 failures, 0 errors, 0 skips
</code></pre></div>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/3222'>https://github.com/openstreetmap/openstreetmap-website/pull/3222</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Skip intermediate lengths when testing tag validity</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3222/files#diff-f71810edf41ac520b7232a82bab9cd0ff5490e215a2bb9a3acd3a7094301ab57">test/models/changeset_tag_test.rb</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3222/files#diff-f6440fd3336b11c0501071041975ac6af9da2d69fbc0a209213bf226a8b4f560">test/models/message_test.rb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3222/files#diff-4dce7119318fc3034f2d72ffe84dc5fc634ae6fa13b2dabdf3640131bfc5eb98">test/models/node_tag_test.rb</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3222/files#diff-763bafb88e258710a4e340f4fd1b34fd16dc4c3bc29972a817d591482e6fbd1b">test/models/old_node_tag_test.rb</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3222/files#diff-622b56f9eecc03fb430a353ff685f96951f19eb229d423a6b10374946df7cfac">test/models/old_relation_tag_test.rb</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3222/files#diff-869d958577af901fd1209c078ce87ee2407e6cb22910d8825ee07d48b98011ca">test/models/old_way_tag_test.rb</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3222/files#diff-94144fb56994e0297e799d72d840cabaea97c3e915d53b396f18dc38f4b1a3d6">test/models/relation_tag_test.rb</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3222/files#diff-0f73892c02129f3d9cd2a2b5948ebd52c473f67eebfb7ac670071a7fa3320160">test/models/user_preference_test.rb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3222/files#diff-ea4f9e44f635a4483449a074aef7654c9a5d8f58b48907cb2c8c69c5db850980">test/models/way_tag_test.rb</a>
    (4)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/3222.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/3222.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/3222.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/3222.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3222">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLPFGRIHG2GQ6AARHXDTTBRULANCNFSM46Y7AYYA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAK2OLMMZ7KAZFKHJN3RECTTTBRULA5CNFSM46Y7AYYKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4NXZZUWA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/3222",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/3222",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>