Tests: Implement unit test for

This commit is contained in:
Jürg Lehni 2017-02-21 22:10:08 +01:00
parent ed57b82b19
commit f16b91e0fe

View file

@ -222,6 +222,24 @@ test('#1197', function() {
]);
});
test('#1233', function() {
var p = new Path([
[274, 253],
[274.39360933873525, 252.93741452470064, 0, 0, -0.6159287834059803, 0.8638915013756937],
[271.7973629022481, 254.56035493761536, 1.0464052751698083, -0.17525065612978258, 0, 0],
[275.08184882141563, 249.9554467894288, 0, 0, 0.17503510398097794, 1.0465180359346082],
[274.39259699481335, 252.93883376712415, 0.6163491637478691, -0.8636845462953266, 0, 0],
[273.5560469948133, 254.11108376712414],
true
]);
p.scale(100);
testIntersections(p.getIntersections(), [
{ point: { x: 366.12645, y: 320.20927 }, index: 1, time: 0, crossing: false },
{ point: { x: 366.02122, y: 320.3568 }, index: 1, time: 0.00057, crossing: true },
{ point: { x: 300.67554, y: 391.76337 }, index: 1, time: 0.30838, crossing: true }
]);
});
test('#1239', function() {
var p1 = new Path([[890.91, 7.52, 0, 0, 85.40999999999997, 94.02], [1024, 351.78, 0, -127.03999999999996, 0, 127.14999999999998], [890.69, 696.28, 85.54999999999995, -94.03999999999996, 0, 0], [843.44, 653.28, 0, 0, 75.20000000000005, -82.66999999999996], [960, 351.78, 0, 111.75, 0, -111.63], [843.65, 50.51999999999998, 75.07000000000005, 82.63999999999999, 0, 0], true]);
var p2 = new Path([[960, 352, -0.05999999999994543, 111.67999999999995, 0, 0], [1024, 352, 0, 0, -0.05999999999994543, 127.07], [890.69, 696.28, 85.5, -93.98000000000002, 0, 0], [843.44, 653.28, 0, 0, 75.14999999999998, -82.61000000000001], true]);