diff options
Diffstat (limited to 'tests/gallery-widgets')
| -rw-r--r-- | tests/gallery-widgets/test-gallery-widget.el | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/gallery-widgets/test-gallery-widget.el b/tests/gallery-widgets/test-gallery-widget.el index c0d38b4..9a3c29f 100644 --- a/tests/gallery-widgets/test-gallery-widget.el +++ b/tests/gallery-widgets/test-gallery-widget.el @@ -54,6 +54,26 @@ (should-error (gallery-widget--needle-angle "fifty")) (should-error (gallery-widget--needle-angle nil))) +;;; --- shared SVG geometry --- + +(ert-deftest gallery-widget-semicircle-path-normal () + "A semicircle path is derived from center and radius, not copied literals." + (should (equal (gallery-widget--semicircle-path 48 48 47) + "M 1 48 A 47 47 0 0 1 95 48"))) + +(ert-deftest gallery-widget-semicircle-path-can-close-a-hub () + "The same geometry helper closes the smaller half-dome hub." + (should (equal (gallery-widget--semicircle-path 48 48 4 t) + "M 44 48 A 4 4 0 0 1 52 48 Z"))) + +(ert-deftest gallery-widget-source-uses-only-public-dom-append () + "The renderer must not depend on svg.el's private `svg--append' API." + (with-temp-buffer + (insert-file-contents + (expand-file-name "docs/prototypes/gallery-widget.el" + test-gallery-widget--root)) + (should-not (search-forward "svg--append" nil t)))) + ;;; --- rendered SVG structure --- (defun test-gallery-widget--svg-string (value) |
