aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test-pearl-convert.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test-pearl-convert.el b/tests/test-pearl-convert.el
index 4125e22..1337439 100644
--- a/tests/test-pearl-convert.el
+++ b/tests/test-pearl-convert.el
@@ -168,5 +168,19 @@ the conversion-tier docstring) and are excluded here."
"| a | b |\n|---|---|"))
(should (string= md (pearl--org-to-md (pearl--md-to-org md))))))
+(ert-deftest test-pearl-convert-roundtrip-boundary-cases ()
+ "Round-trip identity holds across markdown boundary cases — the property that
+keeps a fetch + no-edit push from changing the remote. Two of these round-trip
+safely despite an imperfect intermediate Org form: a URL containing parens, and
+inline code whose contents look like markdown (rendered converted in the Org
+view, but reversed exactly on push)."
+ (dolist (md '("[a](u1) and [b](u2)" ; multiple links on a line
+ "see [docs](http://x.com/(p))" ; parens inside the URL
+ "`**b** and [l](u) and _i_`" ; markdown-looking inline code
+ "café — naïve 日本語 ✓" ; non-ASCII prose
+ "before\n```\nunclosed code\nmore code" ; unclosed fence, no swallow
+ "text\n```python\nx = 1\n```\nafter")) ; fence with trailing text
+ (should (string= md (pearl--org-to-md (pearl--md-to-org md))))))
+
(provide 'test-pearl-convert)
;;; test-pearl-convert.el ends here