<p dir="auto">The BDD tests offer different means to check database content, so the conversion is not exactly 1:1 but tries to follow the intention of the tests. There is one commit per converted tests to make review easier. <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/joto/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/joto">@joto</a> please check if the tests still do what they are supposed to do.</p>
<p dir="auto">Two new BDD phrases have been introduced:</p>
<ul dir="auto">
<li>If 'exactly' is added to a 'table ... contains' test, then the table must contain exactly the given rows and will error out if there are too many tables. Duplicate entries work fine. You have to add duplicate entries in the table. (Remember that rows are only compared on the expected columns. If the table has other columns, then they are ignored.)</li>
<li>Geometry comparison is now possible for 'table .. contains'. Trigger a comparison by using the ST_AsText() function around the expected column. Geometries need to be given in the format <a href="https://github.com/openstreetmap/osm2pgsql/blob/eea72d8868015d5a7f3bca48df2cd99f1c6e2feb/tests/bdd/steps/geometry_factory.py#L20">explained in GeometryFactory</a>. For an example see the bbox test.</li>
</ul>

<hr>

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

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/commits/389b18ffa2473b721df99d80b5e2579544066068" class="commit-link">389b18f</a>  move test-output-flex-attr to BDD</li>
  <li><a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/commits/909005d033861ad0aeac35b8e4d13599936c36ce" class="commit-link">909005d</a>  convert test-output-flex-bbox to BDD tests</li>
  <li><a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/commits/257b99f1520628f2384354ca349e53dba524ae46" class="commit-link">257b99f</a>  convert test-output-flex-cluster to BDD test</li>
  <li><a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/commits/f78aa37578c96f354a4ef215445fe4043767147e" class="commit-link">f78aa37</a>  convert test-output-flex-invalid-geom to BDD test</li>
  <li><a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/commits/4272c7d51602247ce1fc2f1fe5090d2f81fdfdd7" class="commit-link">4272c7d</a>  convert test-output-flex-line to BDD test</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/files">17 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/files#diff-4461c617ceae0c7e0206622aacdf555aedd62eb129c2efb74c84fa1567bcbe0d">tests/CMakeLists.txt</a>
    (5)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/files#diff-39786ccfd95a21edcd9a8544b0af1eb1d9c1f1043893acb8286c4adb0bf61bcd">tests/bdd/flex/bbox.feature</a>
    (68)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/files#diff-8c3ca13023b11502d8cb39db73c2bda9dfa64316cd3801f5ca775691b5d02c17">tests/bdd/flex/extra_attributes.feature</a>
    (71)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/files#diff-cc273e0e8dbb0f805a0d8be7c1b3cc80e86e5f9a43ee457345f82d93d72a141c">tests/bdd/flex/invalid_geometries.feature</a>
    (126)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/files#diff-3a7e4f283c84565d97dc40484eed801e6f05153f1a8bceea79ce496407f5f710">tests/bdd/flex/line_spliiting.feature</a>
    (50)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/files#diff-f61a441fbc99c6bfc52027ff43a8d00dca36ae09f6cc23a5f46ae6f80aa4d4ee">tests/bdd/flex/nocluster.feature</a>
    (44)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/files#diff-623eaa8a1e6cf6c4935904c2f2228f3a4484965decc2b29bae4a88f870c2ee4e">tests/bdd/steps/steps_db.py</a>
    (74)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/files#diff-d3edc7edf4ff21b794aea78d1dca2a7751f08d786bd0f2afb183d547510a3e6e">tests/data/test_output_flex_attr.lua</a>
    (20)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/files#diff-65d4d0647fc4dfa642c73368d4ef6dd29f9b55763408daec6c406d7791181b9a">tests/data/test_output_flex_bbox.lua</a>
    (40)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/files#diff-3a786bdf9e05a81675a2313b4e1e40531fbeccd9c64361fffe77f7789e932185">tests/data/test_output_flex_invalid_geom.lua</a>
    (45)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/files#diff-858f47b15c4c94b8819e8c79b2289a4b797de94cf35a71f77197ad38e9f9a917">tests/data/test_output_flex_line.lua</a>
    (24)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/files#diff-15b889d349d38f20927677ca4de794c19b158eb096d7cee2281d20582a9db1c3">tests/data/test_output_flex_nocluster.lua</a>
    (29)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/files#diff-00ec8427beea17aa4a784cf1504789c7f7d082addac21efa56a29ddc052ba6c7">tests/test-output-flex-attr.cpp</a>
    (87)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/files#diff-3fb3646c7a6cc3b72ce033adf81d078f1d2f2a8e39c799934b6b946a6fb37d87">tests/test-output-flex-bbox.cpp</a>
    (78)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/files#diff-957052f68109f05426e81eb17072b101f89be69938059fa17084193ae75b5108">tests/test-output-flex-cluster.cpp</a>
    (28)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/files#diff-93d48164879aefd183f457158db1d157313cc658b0907592660fb234fd703991">tests/test-output-flex-invalid-geom.cpp</a>
    (101)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1678/files#diff-99962e8f8cf22e1b05a104fd8380b9b5e5e87a39095acaba63374f6d1c3529ca">tests/test-output-flex-line.cpp</a>
    (45)
  </li>
</ul>

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

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/osm2pgsql/pull/1678">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353ULO26W36MV2A3SRFTVMIIYZANCNFSM5XGTLZ2A">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AA6353XH5JH4DGV3CGXZ5BDVMIIYZA5CNFSM5XGTLZ2KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4SU2H7UA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/osm2pgsql/pull/1678</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/osm2pgsql/pull/1678",
"url": "https://github.com/openstreetmap/osm2pgsql/pull/1678",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>