(require 'ert)
(require 'scxml-drawing-arrow)

(ert-deftest test-scxml--arrow-path-simplify ()
  (let ((path-pts (list (scxml-point- 39.0 19.0)
                        (scxml-point- 39.0 27.21052631578948)
                        (scxml-point- 51.44444444444444 27.21052631578948)
                        (scxml-point- 51.44444444444444 27.0)
                        (scxml-point- 55.0 27.0)))
        (slack-x 1.0)
        (slack-y 1.0))
    (let ((output-path (scxml--arrow-path-simplify path-pts slack-x slack-y))
          (expected-path (list (scxml-point- 39 19)
                               (scxml-point- 39 27)
                               (scxml-point- 55 27))))
      (should (scxml-almost-equal (scxml-path :points output-path)
                                  (scxml-path :points expected-path))))))
