[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: call for more ert tests
From: |
Stefan Monnier |
Subject: |
Re: call for more ert tests |
Date: |
Mon, 24 Jun 2013 23:02:14 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
>>> One thing that would help with that is to allow structural pattern
>>> matching. For example, say I have a function `foo` which returns a list
>>> '(a b c), but all I care about is that `b` is `b`. Then I could write:
>>>
>>> (shouldBe (foo) '(_ b _))
>>>
>>> `shouldBe` then raises an exception if the pattern fails to match.
>> Use pcase?
> pcase does not imply an assertion of equality, which the above does. I'm not
> capturing the second element of the list in a variable named 'b', I'm
> asserting that the second element is equal to the symbol 'b'.
I think he means that it should be easy to make a shouldbe-pcase macro
that provides this kind of behavior using using pcase (the pattern
would look like `(,_ b ,_) instead of the one you wrote).
Stefan
- Re: call for more ert tests, (continued)
- Re: call for more ert tests, Lennart Borgman, 2013/06/24
- Re: call for more ert tests, Sebastian Wiesner, 2013/06/24
- Re: call for more ert tests, Eli Zaretskii, 2013/06/24
- Re: call for more ert tests, Sebastian Wiesner, 2013/06/24
- Re: call for more ert tests, Eli Zaretskii, 2013/06/24
- Re: call for more ert tests, Lennart Borgman, 2013/06/24
- Re: call for more ert tests, Óscar Fuentes, 2013/06/24
- Re: call for more ert tests, John Wiegley, 2013/06/24
- Re: call for more ert tests, Leo Liu, 2013/06/24
- Re: call for more ert tests, John Wiegley, 2013/06/24
- Re: call for more ert tests,
Stefan Monnier <=
- Re: call for more ert tests, Stephen J. Turnbull, 2013/06/24
- Re: call for more ert tests, Eli Zaretskii, 2013/06/25
- Re: call for more ert tests, Lars Magne Ingebrigtsen, 2013/06/25
- Re: call for more ert tests, Juanma Barranquero, 2013/06/25
- Re: call for more ert tests, Eli Zaretskii, 2013/06/25
- Re: call for more ert tests, Lars Magne Ingebrigtsen, 2013/06/25
- Re: call for more ert tests, Eli Zaretskii, 2013/06/25
- Re: call for more ert tests, Sebastian Wiesner, 2013/06/25
- Re: call for more ert tests, Lars Magne Ingebrigtsen, 2013/06/25
- Re: call for more ert tests, Ted Zlatanov, 2013/06/28