[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#24509: 25.1.50; backquotes cause testcover to report 1value errors

From: Gemini Lasswell
Subject: bug#24509: 25.1.50; backquotes cause testcover to report 1value errors
Date: Thu, 22 Sep 2016 08:52:28 -0700

Backquote syntax can cause testcover to report "Value of form marked with 
‘1value’ does vary” errors. Here is some code with two different variations of 
the problem:

(defmacro my-lambda (&rest body)
  `(lambda () ,@body))

(defun my-example ()
  (let ((lambda-1 (my-lambda (message "lambda-1")))
        (lambda-2 (my-lambda (message "lambda-2"))))
    (funcall lambda-1)
    (funcall lambda-2)))

(defmacro my-print-symbol (name)
  `(message "the symbol is %s" ',name))

(defun my-example-2 ()
  (my-print-symbol foo)
  (my-print-symbol bar))

To reproduce the bug:
1. save the above code into a file
2. emacs -Q
3. M-x eval-expression RET (require ‘testcover) RET
4. M-x testcover-start RET filename RET

To make the attached stack trace:
5. M-x toggle-debug-on-error RET
6. M-x eval-expression RET (my-example-2) RET

In my opinion testcover should not be claiming that it is an error if its 
1value determination is incorrect. There is no error in the code being tested, 
there is just a shortcoming in the heuristics that testcover is using to figure 
out what color splotch to put on the line. But if a form has returned a second 
value, that code has had adequate coverage and no splotch is necessary.

Attachment: testcover-backtrace.txt
Description: Text document

In GNU Emacs (x86_64-apple-darwin15.6.0, NS appkit-1404.47 Version 
10.11.6 (Build 15G1004))
of 2016-09-19 built on malolo.local
Windowing system distributor 'Apple', version 10.3.1404
Recent messages:
You can run the command ‘eval-expression’ with M-:
Edebug: my-lambda
Edebug: my-example
Eager macro-expansion failure: (error "Value of form marked with ‘1value’ does 
vary: (lambda nil (message lambda-2))")
Edebug: my-print-symbol
Edebug: my-example-2
Eager macro-expansion failure: (error "Value of form marked with ‘1value’ does 
vary: (message the symbol is %s (quote bar))")
You can run the command ‘testcover-start’ with M-x tes-s RET
Eager macro-expansion failure: (error "Value of form marked with ‘1value’ does 
vary: (message the symbol is %s (quote bar))")

Configured using:
'configure --with-ns'

Configured features:

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

(shadow sort mail-extr emacsbug message subr-x puny seq byte-opt gv
bytecomp byte-compile cl-extra help-mode cconv dired dired-loaddefs
format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config
gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils testcover edebug easymenu
cl-loaddefs pcase cl-lib time-date mule-util tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win
ucs-normalize term/common-win tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core term/tty-colors frame cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote kqueue cocoa ns multi-tty
make-network-process emacs)

Memory information:
((conses 16 208822 9083)
(symbols 48 20772 0)
(miscs 40 54 207)
(strings 32 19256 5265)
(string-bytes 1 616985)
(vectors 16 35113)
(vector-slots 8 671287 4994)
(floats 8 179 99)
(intervals 56 227 22)
(buffers 976 12))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]