(should-error (nreverse 1))
(should-error (nreverse (make-char-table 'foo)))
(should (equal (nreverse (copy-sequence "xyzzy")) "yzzyx"))
- (let ((A (vector)))
- (nreverse A)
- (should (equal A [])))
- (let ((A (vector 0)))
- (nreverse A)
- (should (equal A [0])))
- (let ((A (vector 1 2 3 4)))
- (nreverse A)
- (should (equal A [4 3 2 1])))
- (let ((A (vector 1 2 3 4)))
- (nreverse A)
- (nreverse A)
- (should (equal A [1 2 3 4])))
+ (let* ((A (vector))
+ (B (nreverse A)))
+ (should (equal A []))
+ (should (eq B A)))
+ (let* ((A (vector 0))
+ (B (nreverse A)))
+ (should (equal A [0]))
+ (should (eq B A)))
(let* ((A (vector 1 2 3 4))
- (B (nreverse (nreverse A))))
- (should (equal A B))))
+ (B (nreverse A)))
+ (should (equal A [4 3 2 1]))
+ (should (eq B A)))
+ (let* ((A (vector 1 2 3 4))
+ (B (nreverse A))
+ (C (nreverse A)))
+ (should (equal A [1 2 3 4]))
+ (should (eq B A))
+ (should (eq C A))))
(ert-deftest fns-tests-reverse-bool-vector ()
(let ((A (make-bool-vector 10 nil)))
(ert-deftest fns-tests-nreverse-bool-vector ()
(let ((A (make-bool-vector 10 nil)))
(dotimes (i 5) (aset A i t))
- (nreverse A)
- (should (equal [nil nil nil nil nil t t t t t] (vconcat A)))
- (should (equal [t t t t t nil nil nil nil nil] (vconcat (nreverse A))))))
+ (let ((B (nreverse A)))
+ (should (eq B A))
+ (should (equal [nil nil nil nil nil t t t t t] (vconcat A)))
+ (should (equal [t t t t t nil nil nil nil nil] (vconcat (nreverse A)))))))
(defconst fns-tests--string-lessp-cases
`(("abc" < "abd")