Subject: Re: bug#30905: Add tests for buffer-base-buffer function

From: Shanavas M <[email-masked]>
Date: Wed, 28 Mar 2018 12:41:40 +0300

On Sunday 25 March 2018 02:42 PM, Noam Postavsky wrote:

> A couple of things.
>
> Have assigned copyright for Emacs? (the change is small enough to
> install regardless, but note that we only accept up to 15 lines worth of
> unassigned code per person).
I have send the request. Waiting for reply.
> You should add a ChangeLog style entry to the commit message, as
> described in CONTRIBUTE.
Updated
>    
>> +(ert-deftest test-buffer-base-buffer-indirect ()
>> +  (let* ((base (get-buffer-create "base")
> You should rather use with-temp-buffer, so that the test will not
> interfere with anything else (same for the second test).
>
Updated.
>
>From c1627cb453a6aceba36305417d5ac6b1e63e7021 Mon Sep 17 00:00:00 2001
From: Shanavas M <[email-masked]>
Date: Thu, 22 Mar 2018 12:20:22 +0300
Subject: [PATCH] Add tests for buffer-base-buffer function

* test/src/buffer-tests.el (test-buffer-base-buffer-indirect)
  (test-buffer-base-buffer-non-indirect): Add tests for
  `buffer-base-buffer'
---
 test/src/buffer-tests.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el
index f9c477fbfd..d115e66817 100644
--- a/test/src/buffer-tests.el
+++ b/test/src/buffer-tests.el
@@ -50,4 +50,14 @@
                             (progn (get-buffer-create "nil")
                                    (generate-new-buffer-name "nil")))))
 
+(ert-deftest test-buffer-base-buffer-indirect ()
+  (with-temp-buffer
+    (let* ((ind-buf-name (generate-new-buffer-name "indbuf"))
+           (ind-buf (make-indirect-buffer (current-buffer) ind-buf-name)))
+      (should (eq (buffer-base-buffer ind-buf) (current-buffer))))))
+
+(ert-deftest test-buffer-base-buffer-non-indirect ()
+  (with-temp-buffer
+    (should (eq (buffer-base-buffer (current-buffer)) nil))))
+
 ;;; buffer-tests.el ends here
-- 
2.11.0