[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dynamic modules: should should-error work?
From: |
Eli Zaretskii |
Subject: |
Re: Dynamic modules: should should-error work? |
Date: |
Tue, 24 Nov 2015 21:32:28 +0200 |
> From: Philipp Stephani <address@hidden>
> Date: Tue, 24 Nov 2015 19:27:32 +0000
> Cc: address@hidden
>
> + (let ((descr (should-error (mod-test-sum 1 2 3))))
> + (should (eq (car descr) 'wrong-number-of-arguments))
>
>
> I think testing using :type would also accept subtypes of the given type,
> which
> I think would be preferrable (I'd expect that generally subtypes of the
> documented signals are allowed to be thrown).
I'm not sure I understand what you are saying. Can you give an
example?
> + (should (stringp (nth 1 descr)))
> + (should (eq 0
> + (string-match "#<module function at \\(0x\\)?[0-9a-fA-F]+>"
> + (nth 1 descr))))
> + (should (= (nth 2 descr) 3))))
>
> Maybe replace the regex with "\\`#<module function.*>\\'" to make it work if
> dladdr is available.
That's what I did in the final commit a few minutes ago.
Thanks.