-
Notifications
You must be signed in to change notification settings - Fork 92
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
WIP: update tests #131
WIP: update tests #131
Conversation
(require 'test (expand-file-name "../test.el" | ||
twittering-test-dir)) | ||
(setq twittering-test-dir (file-name-directory | ||
(or load-file-name buffer-file-name))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Falling back to buffer-file-name
lets us run this interactively.
(dolist (file-name (directory-files twittering-test-dir)) | ||
(when (string-match "^test-" file-name) | ||
(let ((file-name (expand-file-name file-name twittering-test-dir))) | ||
(load file-name)))) | ||
|
||
(test-run-all-cases) | ||
|
||
(let* ((fail-count (cdr (assoc 'fail test-last-summary))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test-last-summary
was removed from test.el in 0.9.1.
(end-of-buffer) | ||
(search-backward-regexp "" nil t) | ||
(beginning-of-buffer) | ||
(while (search-forward-regexp "\\b\\([0-9]+\\) pass\\b" nil t) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point test.el changed *test-result*
to be a read-only buffer, so none of this code seems to work anymore.
(twittering-user-agent)) | ||
) | ||
(progn | ||
(setq twittering-user-agent-function 'twittering-user-agent-default-function) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can tell the tests aren't always run in the exact order that the forms are given, so (setq twittering-user-agent-function (lambda () "foo user agent"))
was being evaluated before the
(test-assert-string-equal (format "Emacs/%d.%d Twittering-mode/%s" [...]
test, causing it to fail.
Do you need anything from me before you can merge this? |
I don't have commit rights; I'm waiting to hear from @cvmat |
Ah! Sorry for the noise. |
I marked this as Work In Progress since I don't know the code well enough to be sure I didn't break anything. But now I can run
make check
, so this fixes #119.