Skip to content

Commit 30c18c6

Browse files
authored
Update combine_ways.test.js
1 parent 6b13d48 commit 30c18c6

File tree

1 file changed

+56
-56
lines changed

1 file changed

+56
-56
lines changed

test/combine_ways.test.js

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -13,70 +13,70 @@ import { Shape } from 'three';
1313
import { BuildingShapeUtils } from '../src/extras/BuildingShapeUtils.js';
1414
// import { JSDOM } from 'jsdom';
1515

16-
describe('Combine Ways', () => {
17-
test.each([
16+
describe.each([
17+
[
18+
['<way id="1"><nd ref="1"/><nd ref="2"/><nd ref="3"/><nd ref="4"/></way>',
19+
], 0, 0, 'Single Open Way',
20+
],
21+
[
1822
[
19-
['<way id="1"><nd ref="1"/><nd ref="2"/><nd ref="3"/><nd ref="4"/></way>',
20-
], 0, 0, 'Single Open Way',
21-
],
23+
'<way id="1"><nd ref="1"/><nd ref="2"/></way>',
24+
'<way id="2"><nd ref="2"/><nd ref="3"/></way>',
25+
'<way id="3"><nd ref="3"/><nd ref="1"/></way>',
26+
], 1, 4, 'Test combining 3 ways 1->2->3',
27+
],
28+
[
2229
[
23-
[
24-
'<way id="1"><nd ref="1"/><nd ref="2"/></way>',
25-
'<way id="2"><nd ref="2"/><nd ref="3"/></way>',
26-
'<way id="3"><nd ref="3"/><nd ref="1"/></way>',
27-
], 1, 4, 'Test combining 3 ways 1->2->3',
28-
],
30+
'<way id="1"><nd ref="1"/><nd ref="2"/></way>',
31+
'<way id="2"><nd ref="3"/><nd ref="1"/></way>',
32+
'<way id="3"><nd ref="2"/><nd ref="3"/></way>',
33+
], 1, 4, 'Test combining 3 ways 2->1->3',
34+
],
35+
[
2936
[
30-
[
31-
'<way id="1"><nd ref="1"/><nd ref="2"/></way>',
32-
'<way id="2"><nd ref="3"/><nd ref="1"/></way>',
33-
'<way id="3"><nd ref="2"/><nd ref="3"/></way>',
34-
], 1, 4, 'Test combining 3 ways 2->1->3',
35-
],
37+
'<way id="1"><nd ref="1"/><nd ref="2"/></way>',
38+
'<way id="2"><nd ref="3"/><nd ref="2"/></way>',
39+
'<way id="3"><nd ref="3"/><nd ref="1"/></way>',
40+
], 1, 4, 'Test combining tip to tip',
41+
],
42+
[
3643
[
37-
[
38-
'<way id="1"><nd ref="1"/><nd ref="2"/></way>',
39-
'<way id="2"><nd ref="3"/><nd ref="2"/></way>',
40-
'<way id="3"><nd ref="3"/><nd ref="1"/></way>',
41-
], 1, 4, 'Test combining tip to tip',
42-
],
44+
'<way id="1"><nd ref="1"/><nd ref="2"/></way>',
45+
'<way id="2"><nd ref="1"/><nd ref="3"/></way>',
46+
'<way id="3"><nd ref="2"/><nd ref="3"/></way>',
47+
], 1, 4, 'Test combining tail to tail',
48+
],
49+
[
4350
[
44-
[
45-
'<way id="1"><nd ref="1"/><nd ref="2"/></way>',
46-
'<way id="2"><nd ref="1"/><nd ref="3"/></way>',
47-
'<way id="3"><nd ref="2"/><nd ref="3"/></way>',
48-
], 1, 4, 'Test combining tail to tail',
49-
],
51+
'<way id="1"><nd ref="1"/><nd ref="2"/></way>',
52+
'<way id="2"><nd ref="3"/><nd ref="4"/></way>',
53+
'<way id="3"><nd ref="4"/><nd ref="1"/></way>',
54+
'<way id="4"><nd ref="2"/><nd ref="3"/></way>',
55+
], 1, 5, 'Test combining 4 ways',
56+
],
57+
[
5058
[
51-
[
52-
'<way id="1"><nd ref="1"/><nd ref="2"/></way>',
53-
'<way id="2"><nd ref="3"/><nd ref="4"/></way>',
54-
'<way id="3"><nd ref="4"/><nd ref="1"/></way>',
55-
'<way id="4"><nd ref="2"/><nd ref="3"/></way>',
56-
], 1, 5, 'Test combining 4 ways',
57-
],
59+
'<way id="1"><nd ref="1"/><nd ref="2"/></way>',
60+
'<way id="2"><nd ref="3"/><nd ref="2"/></way>',
61+
], 0, 0, 'Test combining 2 open ways into one open way',
62+
],
63+
[
5864
[
59-
[
60-
'<way id="1"><nd ref="1"/><nd ref="2"/></way>',
61-
'<way id="2"><nd ref="3"/><nd ref="2"/></way>',
62-
], 0, 0, 'Test combining 2 open ways into one open way',
63-
],
65+
'<way id="1"><nd ref="1"/><nd ref="2"/></way>',
66+
'<way id="2"><nd ref="3"/><nd ref="2"/></way>',
67+
'<way id="3"><nd ref="4"/><nd ref="5"/></way>',
68+
], 0, 0, 'Test combining 3 open ways into 2 open ways',
69+
],
70+
[
6471
[
65-
[
66-
'<way id="1"><nd ref="1"/><nd ref="2"/></way>',
67-
'<way id="2"><nd ref="3"/><nd ref="2"/></way>',
68-
'<way id="3"><nd ref="4"/><nd ref="5"/></way>',
69-
], 0, 0, 'Test combining 3 open ways into 2 open ways',
70-
],
71-
[
72-
[
73-
'<way id="1"><nd ref="1"/><nd ref="2"/></way>',
74-
'<way id="2"><nd ref="2"/><nd ref="4"/></way>',
75-
'<way id="3"><nd ref="2"/><nd ref="3"/></way>',
76-
'<way id="4"><nd ref="1"/><nd ref="3"/></way>',
77-
], 1, 3, 'Combining 4 open ways into 1 closed & 1 remaining open way',
78-
],
79-
])('${description}', (ways, length, nodes, description) => {
72+
'<way id="1"><nd ref="1"/><nd ref="2"/></way>',
73+
'<way id="2"><nd ref="2"/><nd ref="4"/></way>',
74+
'<way id="3"><nd ref="2"/><nd ref="3"/></way>',
75+
'<way id="4"><nd ref="1"/><nd ref="3"/></way>',
76+
], 1, 3, 'Combining 4 open ways into 1 closed & 1 remaining open way',
77+
],
78+
])('Combine Ways', (ways, length, nodes, description) => {
79+
test(`${description}`, () => {
8080
let parser = new window.DOMParser();
8181
const xml = [];
8282
for (const way of ways){

0 commit comments

Comments
 (0)