(sweeprolog-end-of-top-term)
(should (= (point) 232))))
+(ert-deftest beginning-of-next-top-term-at-last-clause ()
+ "Test finding the beginning of next top term when there isn't one."
+ (with-temp-buffer
+ (sweeprolog-mode)
+ (insert "
+test_bindings(Name-Value) -->
+ [' '~w = ~p'-[Name-Value] ]..
+")
+ (goto-char 43)
+ (backward-delete-char 1)
+ (end-of-line)
+ (backward-delete-char 1)
+ (should (string= (buffer-string) "
+test_bindings(Name-Value) -->
+ [' ~w = ~p'-[Name-Value] ].
+"
+ ))))
+
(defun sweeprolog-test-indentation (given expected)
(with-temp-buffer
(re-search-forward (rx bol graph) nil t)
(while (and (or (nth 8 (syntax-ppss))
(looking-at-p (rx bol (or "%" "/*"))))
- (not (eobp)))
- (re-search-forward (rx bol graph) nil t)))
- (beginning-of-line)
+ (not (eobp))
+ (re-search-forward (rx bol graph) nil t))))
+ (unless (= p (point)) (beginning-of-line))
(not (= p (point)))))
(defun sweeprolog-end-of-top-term ()