Skip to content

Commit 465e392

Browse files
author
Richard Dodd
committed
test: 💍 add failing offset test
This patch doesn't (yet) have a fix, but it records the problem.
1 parent 7ccb271 commit 465e392

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/offset.rs

+16
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,22 @@ mod tests {
199199
fit_to_bezpath(&co, TOLERANCE);
200200
}
201201

202+
/// Another cubic offset that triggers infinite recursion
203+
// TODO make this test pass and then remove the `#[ignore]`
204+
#[test]
205+
#[ignore]
206+
fn infinite_recursion_2() {
207+
let from = (170316.27471718643, -39426.698755807460);
208+
let ctrl1 = (170319.25792293798, -39424.62015694651);
209+
let ctrl2 = (170347.39228816386, -39459.45980864008);
210+
let to = (170360.02535541012, -39468.51499820177);
211+
let offset = -1.;
212+
let accuracy = 2.231417337053948;
213+
let c = CubicBez::new(from, ctrl1, ctrl2, to);
214+
let co = CubicOffset::new(c, offset);
215+
fit_to_bezpath_opt(&co, accuracy);
216+
}
217+
202218
#[test]
203219
fn test_cubic_offset_simple_line() {
204220
let cubic = CubicBez::new((0., 0.), (10., 0.), (20., 0.), (30., 0.));

0 commit comments

Comments
 (0)