Fix copyright-find-copyright when searching from the end

* lisp/emacs-lisp/copyright.el (copyright-find-copyright): Make
the double check also work when searching from the end (bug#7179).
This commit is contained in:
Lars Ingebrigtsen 2022-01-26 15:02:00 +01:00
parent 8a343ecee5
commit 826959ccb4
2 changed files with 14 additions and 1 deletions

View file

@ -61,5 +61,16 @@
(buffer-substring (- (point-max) 42) (point-max))))
"Copyright 2006, 2007, 2008, 2022 Foo Bar\n\n")))
(ert-deftest test-correct-notice ()
(should (equal
(with-temp-buffer
(dotimes (_ 2)
(insert "Copyright 2021 FSF\n"))
(let ((copyright-at-end-flag t)
(copyright-query nil))
(copyright-update))
(buffer-string))
"Copyright 2021 FSF\nCopyright 2021, 2022 FSF\n")))
(provide 'copyright-tests)
;;; copyright-tests.el ends here