]> git.eshelyaron.com Git - emacs.git/commitdiff
Convert a manual test for nxml-mode to unit test
authorStefan Kangas <stefan@marxist.se>
Mon, 21 Sep 2020 15:55:37 +0000 (17:55 +0200)
committerStefan Kangas <stefan@marxist.se>
Mon, 21 Sep 2020 16:47:55 +0000 (18:47 +0200)
* test/manual/indent/nxml.xml: Delete file.
* test/lisp/nxml/nxml-mode-tests.el
(nxml-mode-test-comment-bug-17264): New test based on deleted file.

test/lisp/nxml/nxml-mode-tests.el
test/manual/indent/nxml.xml [deleted file]

index 624e5c8866d2a329ddf855b7f5e1dab322fde133..54d3bd8d13218abf86f1feb127f5e9b3925e4f01 100644 (file)
   <sub/>
 </t>"))))
 
+(ert-deftest nxml-mode-test-comment-bug-17264 ()
+  "Test for Bug#17264."
+  (with-temp-buffer
+    (nxml-mode)
+    (let ((data "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<spocosy version=\"1.0\" responsetime=\"2011-03-15 13:53:12\" exec=\"0.171\">
+  <!--
+      <query-response requestid=\"\" service=\"objectquery\">
+      <sport name=\"Soccer\" enetSportCode=\"s\" del=\"no\" n=\"1\" ut=\"2009-12-29
+      15:36:24\" id=\"1\">
+      </sport>
+      </query-response>
+  -->
+</spocosy>
+"))
+      (insert data)
+      (goto-char (point-min))
+      (search-forward "<query-response")
+      ;; Inside comment
+      (should (eq (nth 4 (syntax-ppss)) t)))))
+
 (provide 'nxml-mode-tests)
 ;;; nxml-mode-tests.el ends here
diff --git a/test/manual/indent/nxml.xml b/test/manual/indent/nxml.xml
deleted file mode 100644 (file)
index 61b84f2..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<spocosy version="1.0" responsetime="2011-03-15 13:53:12" exec="0.171">
-  <!--
-      <query-response requestid="" service="objectquery">
-      <sport name="Soccer" enetSportCode="s" del="no" n="1" ut="2009-12-29
-      15:36:24" id="1">
-      </sport>
-      </query-response>
-  -->
-</spocosy>