Implement unit-tests for all of @iconexperience's isolated edge cases.

Relates to #784
This commit is contained in:
Jürg Lehni 2016-01-04 12:20:00 +01:00
parent 34d4115061
commit 3e3f32329b
2 changed files with 364 additions and 31 deletions

View file

@ -31,6 +31,12 @@ QUnit.begin(function() {
});
});
var errorHandler = console.error;
console.error = function() {
QUnit.pushFailure([].join.call(arguments, ' '), QUnit.config.current.stack);
errorHandler.apply(this, arguments);
}
// Register a jsDump parser for Base.
QUnit.jsDump.setParser('Base', function (obj, stack) {
// Just compare the string representation of classes inheriting from Base,
@ -77,8 +83,12 @@ function compareItem(actual, expected, message, options, properties) {
// into a group with a white background of the united dimensions of the
// bounds of both items before rasterizing.
var resolution = options.rasterize == true ? 72 : options.rasterize,
bounds = actual.strokeBounds.unite(expected.strokeBounds),
group = actual && expected && new Group({
bounds = actual.strokeBounds.unite(expected.strokeBounds);
if (bounds.isEmpty()) {
QUnit.push(true, 'empty', 'empty', message);
return;
}
var group = actual && expected && new Group({
insert: false,
children: [
new Shape.Rectangle({

View file

@ -13,7 +13,7 @@
module('Path Boolean Operations');
function createPath(str) {
var ctor = str.match(/z/gi).length > 1 ? CompoundPath : Path;
var ctor = (str.match(/z/gi) || []).length > 1 ? CompoundPath : Path;
return new ctor(str)
}
@ -131,34 +131,6 @@ test('#784', function() {
var path2 = new Path('M395.1,453.4c0,15.2-33.8,65-65,65s-65-65-65-65l65-65 C330.1,388.5,395.1,438.2,395.1,453.4z');
compareBoolean(function() { return path1.unite(path2); },
'M265.13434,453.46566l-0.03434,0.03434c0,0 -49.1,-14.5 -36.6,-36.6c7.48073,-13.22593 39.10093,-1.6319 63.28843,9.81157l16.18604,-16.18604c-8.05354,-21.53223 -15.90287,-47.40397 -10.27447,-54.42553c9.77623,-12.51358 31.40373,30.40618 32.36674,32.33326l0.03326,-0.03326c0,0.1 65,49.8 65,65c0,15.2 -33.8,65 -65,65c-30.62393,0 -63.75273,-62.62185 -64.96566,-64.93434z');
var path1 = new Path({
segments: [
[570, 290, 0, 0, 0, 0],
[575.8176000300452, 323.5855681222093, 0, 0, 0, 0],
[547.6444566349796, 309.1465641549448, 0, 0, 0, 0],
[578.8341920603752, 304.57835489946484, 0, 0, -5.7225406635552645e-9, -3.907138079739525e-8],
[519.4675806753132, 313.27349449897866, 0, 0, 0, 0]
],
closed: true,
strokeColor: 'red',
strokScaling: false
});
var path2 = new Path({
segments: [
[575.8176000300631, 323.58556812217466, 0, 0, 0, 0],
[560, 300, 0, 0, 0, 0],
[522.421811145802, 296.21971842903645, 0, 0, 0, 0]
],
closed: true,
strokeColor: 'blue',
strokScaling: false
});
compareBoolean(function() { return path1.unite(path2); },
'M570,290l2.68132,15.47954l6.15287,-0.90118c0,0 -2.36581,0.34651 -6.15287,0.90118l3.13628,18.10603l-28.17314,-14.439c-14.32289,2.0978 -28.17688,4.12693 -28.17688,4.12693l19.08162,-8.78834l-16.12739,-8.26544l27.9654,2.81326z M564.48039,306.68069c-2.28529,0.33471 3.11282,-0.45592 0,0z');
compareBoolean(function() { return path1.subtract(path2); },
'M570,290l2.68132,15.47954l6.15287,-0.90118c0,0 -2.36581,0.34651 -6.15287,0.90118l3.13628,18.10603l-11.33721,-16.90488c-2.28529,0.33471 3.11282,-0.45592 0,0l-4.48039,-6.68069l-9.61279,-0.96702z M547.64446,309.14656c-14.32289,2.0978 -28.17688,4.12693 -28.17688,4.12693l19.08162,-8.78834z');
});
test('#854', function() {
@ -403,3 +375,354 @@ test('Selected edge-cases from @hari\'s boolean-test suite', function() {
compareBoolean(function() { return t.intersect(r); },
'M283.8,324.71094l0,41.45422c1.42504,1.15843 2.79504,2.33005 4.11,3.51485c7.88,7.1 13.66333,14.91 17.35,23.43c3.68667,8.52667 4.97333,17.91 3.86,28.15c-0.36003,3.31143 -0.98987,6.71838 -1.88951,10.22084c1.02,0.27014 2.0765,0.50986 3.16951,0.71916c6.26667,1.2 13.8,1.8 22.6,1.8l8.39102,0c0.08444,-2.79841 -0.02257,-5.56508 -0.32102,-8.3c-0.78746,-7.20773 -2.77831,-14.50893 -5.97256,-21.90361c-1.74009,-0.09727 -3.3059,-0.2294 -4.69744,-0.39639c-3.33333,-0.4 -5.93333,-1.26667 -7.8,-2.6c-1.86667,-1.33333 -3.13333,-3.2 -3.8,-5.6c-0.66667,-2.4 -1,-5.6 -1,-9.6l0,-43.223z');
});
test('Isolated edge-cases from @iconexperience\'s boolean-test suite', function() {
// Test all of @iconexperience's isolated cases in one batch.
// Read more in https://github.com/paperjs/paper.js/issues/784
var data = [[
[
[450, 230, 0, 0, 0, 0],
[362.46932779553646, 264.4394368330295, 0, 0, 0, 0],
[329.00715661950534, 214.6369961279195, 0, 0, 0, 0]
], [
[362.46932779553646, 264.4394368330295, 0, 0, 0.5029830904762775, -0.33795344231873514],
[331.7750437531172, 267.3071389516512, 0.33347583635435285, -3.453534396532916, 0, 0],
[329.00715661950534, 214.6369961279195, 0, 0, 0, 0]
]
], [
[
[211.76470809030513, 391.5530064242439, 0, 0, -1.1306561612996688, -11.284564044000547],
[206.28516988159765, 416.3206370377553, 9.29930425192211, -12.510751934521268, 0, 0],
[142.17355611649077, 367.3087985311291, 0, 0, 0, 0]
], [
[152.06363005021922, 397.5347520600572, 0, 0, 0, 0],
[218.65631922872535, 332.74836297575644, 0, 0, -9.581012775680733, 10.097912103353224],
[211.76470809030513, 391.55300642424385, -1.8914123817368989, -18.8773252964819, 0, 0]
]
], [
[
[138.3141655808707, 456.06810826237086, 0, 0, 1.6246548956081597, -1.188772469512287],
[103.70383447788026, 471.4426853592628, 15.914191732656704, 1.2415901505934812, 0, 0],
[147.64340975918196, 340.17263448268653, 0, 0, 0, 0]
], [
[102.88355437423151, 307.6462971693936, 0, 0, 0, 0],
[311.9175162439421, 379.75248280363354, 0, 0, -68.45789375971557, 0.5465997368099806],
[138.3141655808706, 456.06810826237097, 33.643258081480184, -24.617030422937262, 0, 0]
]
], [
[
[260.5630488345416, 240.11728335016855, 0, 0, 0, 0],
[230.82205831331396, 236.1805613638536, 0, 0, 0, 0],
[300.041224753361, 200, 0, 0, 0, 0],
[300, 300, 0, 0, 0, 0]
], [
[290.30323645974596, 244.0538990495128, 0, 0, 0, 0],
[320, 280, 0, 0, 0, 0],
[230.82205831199582, 236.18056137381197, 0, 0, 0, 0]
]
], [
[
[266.2339624919457, 249.28592706878334, 0, 0, 0, 0],
[236.42561910533144, 245.88969337410168, 0, 0, 0, 0],
[320, 240, 0, 0, 0, 0],
[280, 300, 0, 0, 0, 0]
], [
[296.03993000559, 252.68189006496056, 0, 0, 0, 0],
[320, 300, 0, 0, 0, 0],
[236.42561910512714, 245.8896933758947, 0, 0, 0, 0]
]
], [
[
[109.2693308633721, 249.31916869409733, 0, 0, 0, 0],
[157.6368865573791, 284.8238100271277, 0, 0, 0, 0],
[150, 329.3972954455561, 0, 0, 0, 0]
], [
[109.26933086337212, 249.3191686940973, 0, 0, 0, 0],
[157.1468245594682, 224.11329044817836, 0, 0, 0, 0],
[161.745373658654, 283.93680878488584, 0, 0, -4.753441100107182, 0.365390282896783],
[157.63688655737909, 284.82381002712776, -0.5599416549340219, 0.7628019369743697, 0, 0]
]
], [
[
[249.53400844979302, 269.5706278725207, 0, 0, -5.202299838213264, 1.3434437726778015],
[243.02912232136828, 272.45353289318496, -0.02459817048722357, 0.029126503110205704, 0, 0],
[197.1892333604494, 233.7404268430289, 0, 0, 0, 0]
], [
[243.02912232136822, 272.453532893185, 0, 0, 0.44566136595048533, -0.527704170852985],
[242.66927041668393, 276.2408467361064, -0.16957999946740188, -3.971488536288973, 0, 0],
[197.18923336044946, 233.74042684302884, 0, 0, 0, 0]
]
], [
[
[326.356206851053, 259.5165810014779, 0, 0, 2.309307036608857, -4.052538199979125],
[327.9512902239682, 255.73918757869137, -0.3651148630259513, -1.1113992742978098, 0, 0],
[384.95409529898944, 237.01272999645926, 0, 0, 0, 0],
[350, 300, 0, 0, 0, 0]
], [
[327.9512902239682, 255.73918757869126, 0, 0, 0, 0],
[320, 250, 0, 0, 0, 0],
[384.95409529898944, 237.01272999645937, 0, 0, 0, 0]
]
], [
[
[231.45710796909526, 304.56978671182316, 0, 0, 6.965195106563414, -10.698308411775713],
[230.61969090209206, 265.2654116388295, 4.522412663592235, 13.984636258635192, 0, 0],
[287.7087867546365, 246.8036908431129, 0, 0, 0, 0]
], [
[267.0542186716473, 253.4830551491999, 0, 0, 0, 0],
[230.61969090209206, 265.26541163882956, 0, 0, 2.0144954400552137, 6.22941515281218],
[229.4516168394906, 239.90168380046367, -4.821444118085253, 13.349082266661071, 0, 0]
]
], [
[
[534.4141795042503, 349.4135521611639, 0, 0, 0.9952674258736351, -5.064332094235169],
[518.8256109308445, 384.2317022309883, 13.426353275139377, -9.450213278660101, 0, 0],
[487.8821067425946, 340.2688405948006, 0, 0, 0, 0],
[529.4025393039343, 348.4286400051758, 0, 0, -0.93900751246872, -2.1407484665217567]
], [
[475.5403232814915, 337.8433726698194, 0, 0, 0, 0],
[538.3223483008236, 152.20174200302918, 0, 0, 0, 0],
[576.6459309452254, 198.36777944721226, 0, 0, -12.4717091442418, 10.353077772467884],
[534.4141795042503, 349.41355216116364, 9.869907229687897, -50.22216808367796, 0, 0]
]
], [
[
[100.10301277238074, 299.8360064274938, 0, 0, 0, 0],
[192.98476439737567, 381.03840618337944, 0, 0, 0, 0],
[191.58826071683484, 405.5453629318501, 0, 0, 1.76117811362775, 0.1003589202450712],
[158.80881838193744, 396.40041814383164, 11.345470204261431, 9.97219009394314, 0, 0],
], [
[195.00176127688619, 345.64254151310115, 0, 0, 0, 0],
[481.252611684097, 441.78388187198607, 0, 0, 0, 0],
[448.747388315903, 492.21611812801393, 0, 0, -122.96965958186621, -79.25796175143017],
[191.5882607168351, 405.54536293185015, 35.244503935513166, 2.0083717439883912, 0, 0]
]
], [
[
[201.4099970302107, 456.883477028569, 0, 0, 0, 0],
[226.29027430947582, 456.0825533500981, 0, 0, -0.2832959470065646, -8.800441169464932],
[219.2838668275147, 483.73556312076016, 10.02977284964885, -11.976298343562064, 0, 0],
[200, 500, 0, 0, 0, 0],
], [
[166.32133819059692, 458.01301981440685, 0, 0, 0, 0],
[204.6120898437701, 320.4482218772343, 0, 0, 0, 0],
[244.3462523224993, 365.40593903584846, 0, 0, -18.086870972805855, 15.985390615581537],
[226.29027430947582, 456.08255335009807, -0.8931629157136456, -27.74564118385956, 0, 0]
]
], [
[
[134.30251416753708, 172.0081092040946, 0, 0, 97.01301228604092, -2.2561165647916255],
[223.30038363130024, 161.29265138604404, 7.832155210448377, -11.227084549308643, 0, 0],
[135.69748583246292, 231.99189079590533, 0, 0, 0, 0]
], [
[248.04309709886002, 178.55347910623016, 0, 0, 0, 0],
[223.30038363130373, 161.29265138603904, 0, 0, -6.854532836619114, 9.825701564243673],
[240.2776561840474, 149.3557271403692, -14.092989377677696, 3.748174738020822, 0, 0]
]
], [
[
[517.5047187481108, 202.91541735696418, 6.513140197398911, -18.244597886454756, 0, 0],
[545.7583411018326, 213.0016798561104, 0, 0, 0, 0],
[557.8431595513716, 185.5433980031361, -8.326516730755202, -3.664629555367924, 0, 0],
[545.7583424843119, 213.00167993223172, 0, 0, -1.1368683772161603e-13, 0]
], [
[550.3546243594556, 242.6474912770306, 0, 0, 11.17102286717818, -1.7319541248482437],
[541.1620576122966, 183.35586693936358, -11.180538230113825, 1.733429385644115, 0, 0]
]
], [
[
[290.1253327484206, 287.90652074109494, 0, 0, 0, 0],
[342.6480156335393, 281.88796157138086, 0, 0, 0, 0],
[340.20645047153664, 251.98747653472907, 0, 0, 0, 0],
[370.8816252545162, 292.03012917196776, 0, 0, 0, 0]
], [
[345.08958029318296, 311.78843842619824, 0, 0, 0, 0],
[300.0082518321038, 300.98900280805503, 0, 0, 0, 0],
[340.20645030689445, 251.98747654817316, 0, 0, 0, 0]
]
], [
[
[371.53493854231004, 257.22260275739484, 0, 0, -5.3406979774814545, -1.8674091727692712],
[360.1944182950855, 257.04852958152196, 1.4950314859081004, -0.8166674734584944, 0, 0],
[430.4144838319712, 235.2349421258068, -7.8035474909103755, -18.555544116219835, 0, 0]
], [
[360.1944182950853, 257.0485295815221, 0, 0, 0.09209791202033557, -0.05030888635417341],
[358.8995515281498, 260.3188854078006, 0.4901759953118585, -3.4265416599628793, 0, 0],
[300, 230, 0, 0, 0, 0]
]
], [
[
[409.2490311439771, 253.4403128346141, 0, 0, -4.356295913055419, 1.322648861578557],
[403.6254675741819, 256.25364724519244, 0.0777100557439212, -0.09457550986331853, 0, 0],
[357.2674295740252, 218.16254181654907, 0, 0, 0, 0]
], [
[403.625467574182, 256.2536472451924, 0, 0, 0.27347672342176566, -0.33282952001209765],
[403.0346093549582, 261.0014812561057, -0.21747734382410044, -4.397037948600143, 0, 0],
[357.26742957402513, 218.16254181654915, 0, 0, 0, 0]
]
], [
[
[292.9399983081827, 321.04496242335836, 0, 0, 0, 0],
[301.41124169557446, 297.40574481030876, 0, 0, 0, 0],
[271.4382902635834, 296.1319728479751, 0, 0, 0, 0],
[319.88255402047366, 273.7665574434494, 0, 0, 0, 0]
], [
[331.38418270096264, 298.67951674085646, 0, 0, 0, 0],
[350, 345.76013009266507, 0, 0, 0, 0],
[271.4382902810318, 296.1319724373992, 0, 0, 0, 0]
]
], [
[
[349.2988989052917, 302.360122358839, 0, 0, 0, 0],
[306.8847250793194, 310.8417788081535, 0, 0, 0, 0],
[317.34865046978905, 286.0848942283935, 0, 0, 0, 0],
[295.03238113332606, 289.30770347326694, 0, 0, 0, 0],
], [
[306.8847250793191, 310.8417788081534, 0, 0, 0, 0],
[308.40196713650136, 308.29790890842884, 0, 0, 0, 0],
[297.432392604982, 249.3091944403423, 0, 0, 0, 0],
[330.2439214313423, 255.57562328972034, 0, 0, 0, 0]
]
], [
[
[150, 290, 0, 0, 0, 0],
[180, 260, 0, 0, 0, 0],
[220, 300, 0, 0, 0, 0]
], [
[180, 260, 0, 0, 0, 0],
[230, 270, 0, 0, 0, 0],
[170, 310, 0, 0, 0, 0],
[220, 300, 0, 0, 0, 0]
]
], [
[
[299.7385339651986, 102.20556080028058, -8.846854364457954, -13.558854632211663, 0, 0],
[324.85949771228013, 85.81468459475798, 0, 0, 0, 0],
[331.26017128225755, 56.500458549069435, 0, 0, 0, 0],
[349.988176980811, 69.4187741812245, 0, 0, 9.063133638672639, 13.890328297113285]
], [
[318.4609036471463, 115.11938678905685, 0, 0, 0, 0],
[340.9228398583517, 111.1463404606569, 0, 0, 0, 0],
[308.7912208820021, 60.47525341924158, 0, 0, 0, 0],
[331.2601712818937, 56.50045854899, 0, 0, 0, 0]
]
], [
[
[388.9213889025063, 223.3215931867822, 0, 0, 120.27613015930797, -2.2436869719875574],
[597.6181955110758, 242.94850207232983, 0, 0, 0, 0],
[628.0354673841999, 243.03685701873312, 0, 0, -0.031041118475286567, 10.686285016774008],
[419.2789142850017, 364.27077547853787, 0, 0]
], [
[568.0357205119291, 242.86257201242702, 0, 0, 0, 0],
[576.294245114903, 263.4873716612576, -0, 0, 0, 0],
[619.5200435607698, 221.87571045051882, 0, 0, 0, 0],
[628.0354673841999, 243.03685701876972, 0.030302631585300333, -10.432051860541975, 0, 0]
]
], [
[
[250, 130, 0, 0, 0, 0],
[274.2339539863471, 194.10449080567912, 0, 0, 0.10568701547992987, -0.053016796189552906],
[272.11154618911314, 196.81853259861245, 1.370678992642354, -2.513969427633242, 0, 0]
], [
[250, 130, 0, 0, 0, 0],
[282.64261453718956, 194.05831848298737, 0, 0, -6.1766919512210166, -1.0441192545144133],
[274.23395398634705, 194.10449080567915, 0.11866362575074163, -0.05952637826862883, 0, 0]
]
], [
[
[386.4093435542647, 270.73026596496675, 0, 0, 77.41690321854611, 15.777187877165375],
[528.635149558586, 289.6368596320347, -12.835362144855708, 5.740740187064205, 0, 0],
[553.1321511797777, 344.4081743101702, 0, 0, 0, 0]
], [
[528.6351495585858, 289.6368596320348, 0, 0, -0.31548183780626005, 0.14110231126664985],
[522.9057367288372, 295.33394762583623, 2.3982010141742194, -4.106159119428241, 0, 0],
[574.716309478071, 325.5938972523037, 0, 0, 0, 0],
[553.1321511797779, 344.40817431017007, 0, 0, 0, 0]
]
], [
[
[525, 345, 0, 0, 0, 0],
[557.3179687742295, 363.04379418599376, 0, 0, 0, 0],
[587.1223034990716, 366.54087021669767, 0, 0, 0, 0],
[500, 400, 0, 0, 0, 0]
], [
[527.5311085637297, 359.5487685170587, 0, 0, 0, 0],
[533.6060904205631, 381.4080959083297, 0, 0, 0, 0],
[581.0430044030195, 344.66929908778826, 0, 0, 0, 0],
[587.1223034989287, 366.54087021791537, 0, 0, 0, 0]
]
], [
[
[250, 150, 0, 0, 0, 0],
[234.74625221124325, 182.05024235296503, 0, 0, 0, 0],
[205.60227766791786, 189.2546311484904, 0, 0, 0, 0],
[205.60227766791786, 189.4546311484904, 0, 0, 0, 0],
[205.61255586021304, 189.25209037995552, 0, 0, 0, 0],
[263.84900039629053, 174.85604471078497, 0, 0, 0, 0]
], [
[225.84313834895474, 153.1048226009985, 0, 0, 0, 0],
[180, 190, 0, 0, 0, 0],
[243.48255333255608, 210.4533277169673, 0, 0, 0, 0]
]
], [
[
[598.5486959306086, 408.11025390080914, 0, 0, 0, 0],
[556.2683544908633, 467.2163769525839, 0, 0, 0, 0],
[552.429221746517, 437.22810161381835, 0, 0, 0, 0],
], [
[556.2683546136653, 467.2163769491477, 0, 0, 0, 0],
[518.5330018076562, 379.67700053006695, 0, 0, 0, 0],
[554.5900896267148, 407.2398529865706, 0, 0, 0, 0]
]
], [
[
[570, 290, 0, 0, 0, 0],
[575.8176000300452, 323.5855681222093, 0, 0, 0, 0],
[547.6444566349796, 309.1465641549448, 0, 0, 0, 0],
[578.8341920603752, 304.57835489946484, 0, 0, -5.7225406635552645e-9, -3.907138079739525e-8],
[519.4675806753132, 313.27349449897866, 0, 0, 0, 0]
], [
[575.8176000300631, 323.58556812217466, 0, 0, 0, 0],
[560, 300, 0, 0, 0, 0],
[522.421811145802, 296.21971842903645, 0, 0, 0, 0]
]
]];
var results = [
['M450,230l-87.53067,34.43944l-0.01593,-0.02371c-0.91969,-0.32388 -30.35274,-0.48069 -30.67835,2.89141l-2.76789,-52.67014z', ''],
['M211.76471,391.55301c-1.13066,-11.28456 3.81977,12.25688 -5.47954,24.76763l-28.00902,-21.41225l-26.21252,2.62636l13.04584,-12.69198l-22.93592,-17.53397l30.159,10.50681l46.32376,-45.06725c-9.58101,10.09791 -8.78302,39.92732 -6.89161,58.80464z', 'M178.27615,394.90839l-13.16668,-10.06562l7.22309,-7.02716l39.43215,13.7374z'],
['M138.31417,456.06811c1.62465,-1.18877 -18.69614,16.61617 -34.61033,15.37458l22.34488,-66.7556l-23.16516,-97.04078l209.03396,72.10619c-68.45789,0.5466 -139.96009,51.6986 -173.60335,76.31563z', 'M126.04871,404.68708l21.5947,-64.51445l-9.32924,115.89547z'],
['M300.04122,200l-0.02301,55.81328l19.98178,24.18672l-19.98771,-9.82138l-0.01229,29.82138l-29.04124,-44.09743l-40.1367,-19.722z', 'M300.01822,255.81328l-0.00592,14.36534l-29.05353,-14.27606l-10.39571,-15.78528l29.74019,3.93662z'],
['M320,240l-17.26682,25.90022l17.26682,34.09978l-27.9401,-18.08984l-12.0599,18.08984l-8.52877,-31.42l-35.04561,-22.69031z', 'M302.73318,265.90022l-10.67329,16.00993l-20.58867,-13.33015l-5.23726,-19.29408l29.80597,3.39596z'],
['M157.63421,284.83942l-7.63421,44.55788l-40.73067,-80.07813l47.87749,-25.20588l4.59855,59.82352c-2.48454,0.19098 -3.64723,0.63304 -4.11116,0.90261z', 'M157.63689,284.82381l-0.00267,0.01561c-0.00547,0.00318 -0.01083,0.00633 -0.01611,0.00945c0.0062,-0.0081 0.01246,-0.01645 0.01878,-0.02506z M157.61811,284.84887c-0.25231,0.3297 -0.39376,0.23354 0,0z'],
['M249.53401,269.57063c-5.12674,1.32393 -6.49012,2.86652 -6.50509,2.88317c-0.17123,0.40034 -0.45801,1.48334 -0.35964,3.78705l-45.48004,-42.50042z M243.02893,272.45376c0.00005,-0.00006 0.00012,-0.00014 0.00019,-0.00023l-0.00007,-0.00006c-0.00004,0.0001 -0.00008,0.00019 -0.00012,0.00029z', 'M243.02891,272.4538c-0.00017,0.00019 -0.00017,0.00018 0.00001,-0.00003c0,0.00001 -0.00001,0.00002 -0.00001,0.00003z'],
['M326.35621,259.51658c1.15567,-2.02805 1.46269,-3.25061 1.52678,-3.82669l-7.88299,-5.68989l64.9541,-12.98727l-34.9541,62.98727z', 'M327.88299,255.68989c0.00623,-0.05602 0.01017,-0.10593 0.01237,-0.14987c0.01299,0.05713 0.03113,0.12366 0.05593,0.19917z M327.89536,255.54001c-0.0732,-0.32201 0.01728,-0.34576 0,0z'],
['M231.45711,304.56979c6.9652,-10.69831 3.685,-25.31974 -0.83742,-39.30438c2.0145,6.22942 -5.98952,-12.01465 -1.16807,-25.36373l37.6026,13.58137l20.65457,-6.67936z', ''],
['M534.41418,349.41355c0.99527,-5.06433 -2.16222,25.36794 -15.58857,34.81815l-30.9435,-43.96286l-12.34178,-2.42547l62.78203,-185.64163l38.32358,46.16604c-12.47171,10.35308 -32.36184,100.8236 -42.23175,151.04577z', 'M529.40254,348.42864c-0.93901,-2.14075 5.01164,0.98491 5.01164,0.98491z'],
['M100.10301,299.83601l92.88175,81.2024l2.017,-35.39586l286.25085,96.14134l-32.50522,50.43224c-122.96966,-79.25796 -221.91462,-84.66238 -257.15913,-86.67076c1.76118,0.10036 -21.43397,0.82725 -32.77944,-9.14494z', ''],
['M219.28387,483.73556l-19.28387,16.26444l1.41,-43.11652l-35.08866,1.12954l38.29075,-137.5648l39.73416,44.95772c-18.08687,15.98539 -18.94914,62.93097 -18.05598,90.67661c-0.2833,-8.80044 3.02337,15.67671 -7.00641,27.65301z', ''],
['M134.30251,172.00811c69.89455,-1.62545 89.33749,-12.29848 91.81689,-13.93979c-0.39444,0.32626 -1.16469,1.04523 -2.11233,2.26401c0.67085,-0.74847 1.44456,-1.56236 2.30914,-2.40044c-0.04649,0.03433 -0.11164,0.08005 -0.19681,0.13643c0.13147,-0.10874 0.22118,-0.17386 0.26181,-0.19932c3.45306,-3.33445 8.33582,-7.03437 13.89644,-8.51327l7.76544,29.19775l-24.74271,-17.26083c-3.03845,4.3555 -2.81641,3.24058 -0.39992,0.32276l-87.20297,70.37648z', 'M224.00707,160.33233c-0.22634,0.29111 -0.46281,0.61073 -0.70669,0.96032l-0.39992,0.32276c0.32907,-0.39735 0.69884,-0.82812 1.10661,-1.28308z M226.38122,157.869c0.04659,-0.0292 0.02861,-0.00624 -0.065,0.06289c0.02161,-0.02095 0.04328,-0.04191 0.065,-0.06289z'],
['M517.50472,202.91542l28.24931,10.08472c0.00241,0.00682 0.00483,0.01365 0.00724,0.02047l-0.00293,-0.01893c0,0 0,0 0,0c0,0 0,0 0,0l-4.59628,-29.64581c-5.58903,0.86652 -0.50164,15.25023 4.58932,29.63676c-0.44214,-0.57333 -21.80103,-28.13268 -28.24666,-10.07721z M545.75834,213.00168l12.08482,-27.45828c-8.32546,-3.66417 -12.08387,27.45042 -12.08482,27.45828c0,0 0,0 0,0z M550.35462,242.64749c5.58313,-0.86561 0.49657,-15.24328 -4.59335,-29.62688z', 'M545.75403,213.00014l0.00431,0.00154l0,0c-0.00007,-0.00009 -0.00241,-0.00314 -0.00697,-0.00905c0.00089,0.0025 0.00177,0.00501 0.00266,0.00751z'],
['M290.12533,287.90652l22.75403,-2.60738l27.32709,-33.31167l30.67517,40.04265l-27.52018,-1.40525l1.72814,21.16356l-45.08133,-10.79944l9.90334,-12.07215z', 'M312.87936,285.29914l29.76865,-3.41118l0.71343,8.73692l-33.44985,-1.70803z'],
['M371.53494,257.2226c-5.3407,-1.86741 -9.84549,-0.99074 -11.34052,-0.17407c0,0 0,0 0,0l-0.02947,-0.01324c0.0301,-0.00458 0.04264,0.00337 0.03269,0.01116c0.51449,-0.33235 62.44572,-40.28995 70.21684,-21.8115z M360.16495,257.03529c-0.16487,0.02506 -0.85657,0.42566 -1.2654,3.2836l-58.89955,-30.31889z', 'M360.19442,257.04853c0,0 0.00108,-0.0007 0.00322,-0.00208c-0.00089,0.0007 -0.00197,0.0014 -0.00322,0.00208z'],
['M409.24903,253.44031c-4.3563,1.32265 -5.54585,2.71876 -5.62356,2.81333l-0.01222,-0.01004c-0.1837,0.27203 -0.74035,1.48841 -0.57864,4.75787l-45.76718,-42.83894z', ''],
['M292.94,321.04496l3.31075,-9.23873l-24.81246,-15.67426l0,0l0,0l0,0l0,0l48.44426,-22.36542l-13.5895,23.84665l25.09113,1.06631l18.61582,47.08061l-52.31238,-33.04622z', 'M296.25075,311.80623l5.16049,-14.40049l4.88182,0.20746l-8.60544,15.1007z M271.43829,296.13197l0,0z'],
['M349.2989,302.36012l-42.41417,8.48166l1.38218,-3.27015l-2.93573,-15.78682l-10.2988,-2.47711l9.58086,-1.38362l-7.18085,-38.61489l32.81153,6.26643l-16.1911,38.30696z', 'M304.61324,287.92408l12.73541,-1.83919l-3.29583,7.79769l-8.72164,-2.09777z'],
['M150,290l30,-30l50,10l-24,16l14,14l-50,10l21.17647,-14.11765z', 'M206,286l14,14l-28.82353,-4.11765z'],
['M324.40827,86.1091l0.45123,-0.29442l-16.06828,-25.33943l22.46895,-3.97479l18.72801,12.91832c4.53222,6.94617 -10.24683,11.75354 -25.05014,16.51976l15.98481,25.2078l-22.46194,3.97305l6.36357,-29.14428c-0.13874,0.04467 -0.27748,0.08933 -0.4162,0.134z M324.40827,86.1091l-24.66974,16.09646c-4.37001,-6.69756 10.04945,-11.38915 24.66974,-16.09646z', 'M324.8595,85.81469l0,0l0,0z M324.93803,85.93854c-0.03785,0.01219 -0.07571,0.02438 -0.11356,0.03656l0.03503,-0.16042z'],
['M388.92139,223.32159c120.27613,-2.24369 208.69681,19.62691 208.69681,19.62691l0.0116,0.00003l21.89025,-21.07283c0,0 8.54573,10.72909 8.51542,21.16115c-0.03104,10.68629 -208.75655,121.23392 -208.75655,121.23392z', ''],
['M272.11155,196.81853l-22.11155,-66.81853l32.64261,64.05832c-6.17669,-1.04412 -8.29,-0.01335 -8.40866,0.04617l-0.00118,-0.00313c-0.09777,0.03858 -0.90866,0.4932 -2.12123,2.71717z', 'M274.23395,194.10449l-0.00118,-0.00313c0.01275,-0.00503 0.01337,-0.00299 0.00118,0.00313z'],
['M386.40934,270.73027c77.4169,15.77719 129.39044,24.64733 142.22581,18.90659l5.47489,12.24096l40.60627,23.71608l-21.58416,18.81428z', ''],
['M525,345l32.31797,18.04379l23.72504,-18.37449l6.0793,21.87157l-87.1223,33.45913z', 'M557.31797,363.04379l-23.71188,18.3643l-6.07498,-21.85933z'],
['M250,150l-15.25375,32.05024l-8.90311,-28.94542l-45.84314,36.89518l63.48255,20.45333l-8.7363,-28.40309l29.10275,-7.1942z', 'M205.61256,189.25209l-0.01028,0.00254l0,0.2z'],
['M598.5487,408.11025l-42.28034,59.10612l-37.73535,-87.53938l36.05709,27.56285l0.78705,28.12706z', 'M552.42922,437.2281l2.94792,-1.86119l0.89121,31.84947z'],
['M570,290l2.68132,15.47954l6.15287,-0.90118c0,0 -2.36581,0.34651 -6.15287,0.90118l3.13628,18.10603l-28.17314,-14.439c-14.32289,2.0978 -28.17688,4.12693 -28.17688,4.12693l19.08162,-8.78834l-16.12739,-8.26544l27.9654,2.81326z M564.48039,306.68069c-2.28529,0.33471 3.11282,-0.45592 0,0z', 'M575.8176,323.58557l-28.17314,-14.439l16.83593,-2.46588z M564.48039,306.68069c-5.08619,0.74495 -10.99999,1.61111 -16.83593,2.46588c-14.32289,2.0978 -28.17688,4.12693 -28.17688,4.12693l30.91963,-14.24052l9.61279,0.96702z']
];
for (var i = 0; i < data.length; i++) {
var entry = data[i],
result = results[i],
path1 = new Path({ segments: entry[0], closed: true }),
path2 = new Path({ segments: entry[1], closed: true });
compareBoolean(path1.unite(path2), result[0], 'path1.unite(path2); // Test ' + (i + 1));
compareBoolean(path1.intersect(path2), result[1], 'path1.intersect(path2); // Test ' + (i + 1));
}
});