Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some brittleness in tests #246

Closed
phst opened this issue Aug 31, 2017 · 1 comment
Closed

Some brittleness in tests #246

phst opened this issue Aug 31, 2017 · 1 comment
Labels

Comments

@phst
Copy link
Contributor

phst commented Aug 31, 2017

For example on Ubuntu 12.04:

$ LC_ALL=C make test SELECTOR='(rx bos "test-markdown-font-lock/hidden-urls-")'
emacs -Q --batch  \
	    --eval '(setq byte-compile-warnings (quote (not cl-functions)))' \
	    --eval '(setq byte-compile-error-on-warn t)' \
	    -l ../markdown-mode.el \
	    -f batch-byte-compile ../markdown-mode.el markdown-test.el
emacs -Q --batch  -l checkdoc-batch.el 2>&1 | \
	    grep -E "markdown-mode.el:[1-9]+" && exit 1 || exit 0
emacs -Q --batch  \
	    --eval '(setq byte-compile-warnings (quote (not cl-functions)))' \
	    -l ert -l ../markdown-mode.elc -l markdown-test.elc \
	    --eval '(ert-run-tests-batch-and-exit (rx bos "test-markdown-font-lock/hidden-urls-"))'
Running 2 tests (2017-08-31 21:21:06+0200)
Test test-markdown-font-lock/hidden-urls-inline backtrace:
  #[nil "\306�	\307P�\310 311\216\312\313!�r\fq\210\314\216\315\n!\2
  ert--run-test-internal([cl-struct-ert--test-execution-info [cl-struc
  ert-run-test([cl-struct-ert-test test-markdown-font-lock/hidden-urls
  ert-run-or-rerun-test([cl-struct-ert--stats "\\`test-markdown-font-l
  ert-run-tests("\\`test-markdown-font-lock/hidden-urls-" #[385 "\306�
  ert-run-tests-batch("\\`test-markdown-font-lock/hidden-urls-")
  ert-run-tests-batch-and-exit("\\`test-markdown-font-lock/hidden-urls
  eval((ert-run-tests-batch-and-exit (rx bos "test-markdown-font-lock/
  command-line-1(("--eval" "(setq byte-compile-warnings (quote (not cl
  command-line()
  normal-top-level()
Test test-markdown-font-lock/hidden-urls-inline condition:
    (ert-test-failed
     ((should
       (equal '...
	(get-text-property 932 ...)))
      :form
      (equal
       ((26 . 8734))
       ((26 . 35)))
      :value nil :explanation
      (list-elt 0
		(cdr
		 (different-atoms ... ...)))))
   FAILED  1/2  test-markdown-font-lock/hidden-urls-inline
Test test-markdown-font-lock/hidden-urls-reference backtrace:
  #[nil "\306�\307 �\310\216\311\312!�r\nq\210\313\216\314	p\306#\210\
  ert--run-test-internal([cl-struct-ert--test-execution-info [cl-struc
  ert-run-test([cl-struct-ert-test test-markdown-font-lock/hidden-urls
  ert-run-or-rerun-test([cl-struct-ert--stats "\\`test-markdown-font-l
  ert-run-tests("\\`test-markdown-font-lock/hidden-urls-" #[385 "\306�
  ert-run-tests-batch("\\`test-markdown-font-lock/hidden-urls-")
  ert-run-tests-batch-and-exit("\\`test-markdown-font-lock/hidden-urls
  eval((ert-run-tests-batch-and-exit (rx bos "test-markdown-font-lock/
  command-line-1(("--eval" "(setq byte-compile-warnings (quote (not cl
  command-line()
  normal-top-level()
Test test-markdown-font-lock/hidden-urls-reference condition:
    (ert-test-failed
     ((should
       (equal '...
        (get-text-property 8 ...)))
      :form
      (equal
       ((20 . 8734))
       ((20 . 35)))
      :value nil :explanation
      (list-elt 0
                (cdr
                 (different-atoms ... ...)))))
   FAILED  2/2  test-markdown-font-lock/hidden-urls-reference

Ran 2 tests, 0 results as expected, 2 unexpected (2017-08-31 21:21:06+0200)

2 unexpected results:
   FAILED  test-markdown-font-lock/hidden-urls-inline
   FAILED  test-markdown-font-lock/hidden-urls-reference

make: *** [test] Error 1

This is because with LC_ALL=C Emacs falls back to # for the URL compose character. Given

But the value of the property itself is completely internal to Emacs and should not be manipulated directly by, for instance, put-text-property.

(https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Properties.html for the composition property), maybe the tests should only check whether the property is nil.

@jrblevin jrblevin added the bug label Sep 1, 2017
@jrblevin
Copy link
Owner

jrblevin commented Sep 1, 2017

I had not seen this; thanks for letting me know.

phst added a commit to phst/markdown-mode that referenced this issue Sep 23, 2017
jrblevin added a commit that referenced this issue Sep 25, 2017
Add CHANGES.md entries for the following recent issues and pull
requests:

- GH-227
- GH-238
- GH-246
- GH-254
- GH-257
- GH-258
- GH-259
- GH-260
- GH-261
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants