This page is no longer maintained — Please continue to the home page at www.scala-lang.org

ScalaTest Matchers Preview

4 replies
Bill Venners
Joined: 2008-12-18,
User offline. Last seen 31 weeks 5 days ago.

Hi All,

I just posted a blog showing the matchers syntax I've been working on
for ScalaTest. It should go out in the next release, 0.9.5, sometime
in January. I'm looking for feedback. The blog post is here:

http://www.artima.com/weblogs/viewpost.jsp?thread=246279

You can provide feedback here on the mailing list or on the forum for
the blog post, which is here:

http://www.artima.com/forums/flat.jsp?forum=106&thread=246279

Thanks.

Bill
----
Bill Venners
Artima, Inc.
http://www.artima.com/

Warren Henning
Joined: 2008-12-31,
User offline. Last seen 42 years 45 weeks ago.
Re: ScalaTest Matchers Preview

Coooool.

Warren

On Tue, Dec 30, 2008 at 5:50 PM, Bill Venners wrote:
> http://www.artima.com/weblogs/viewpost.jsp?thread=246279

Viktor Klang
Joined: 2008-12-17,
User offline. Last seen 1 year 27 weeks ago.
Re: ScalaTest Matchers Preview
Hey Bill,

great write-up!

While I agree that one should avoid negations in tests, I firmly believe that "shouldnt" is a way better syntax than "should not {}"

Happy New Year!

On Wed, Dec 31, 2008 at 3:54 AM, Warren Henning <warren [dot] henning [at] gmail [dot] com> wrote:
Coooool.

Warren

On Tue, Dec 30, 2008 at 5:50 PM, Bill Venners <bill [at] artima [dot] com> wrote:
> http://www.artima.com/weblogs/viewpost.jsp?thread=246279



--
Viktor Klang
Senior Systems Analyst
Bill Venners
Joined: 2008-12-18,
User offline. Last seen 31 weeks 5 days ago.
Re: ScalaTest Matchers Preview

Hi Viktor,

I hadn't thought of "shouldnt". I was using shouldNot. That's a good
idea. The must variant would be mustnt. Sounds a bit more of a
stretch, or possibly a bit more British English. andNot and orNot
could stay as they are, or just not have them, because there's no
andnt or ornt! Anyway I'm going to leave any of these out probably in
the first release, so people can report based on experience using them
what's really a pain that needs solving.

Thanks.

Bill

On Wed, Dec 31, 2008 at 3:32 AM, Viktor Klang wrote:
> Hey Bill,
>
> great write-up!
>
> While I agree that one should avoid negations in tests, I firmly believe
> that "shouldnt" is a way better syntax than "should not {}"
>
> Happy New Year!
>
> On Wed, Dec 31, 2008 at 3:54 AM, Warren Henning
> wrote:
>>
>> Coooool.
>>
>> Warren
>>
>> On Tue, Dec 30, 2008 at 5:50 PM, Bill Venners wrote:
>> > http://www.artima.com/weblogs/viewpost.jsp?thread=246279
>
>
>
> --
> Viktor Klang
> Senior Systems Analyst
>

Bill Venners
Joined: 2008-12-18,
User offline. Last seen 31 weeks 5 days ago.
Re: ScalaTest Matchers Preview

Hi Viktor,

Actually, there's one other possibility that I had rejected, but maybe
should reconsider. I can just replicate everything under not, so you
wouldn't need parens. You could negate this:

object should equal (5)

by writing this:

object should not equal (5)

The reason I rejected that was that in the first case, equal requires
parens, but in the second case, it does not require parens. I thought
that would be confusing, but later I started always using parens
around the last token whether they were required or not. Using that
technique it probably wouldn't be confusing.

Bill

On Wed, Dec 31, 2008 at 3:32 AM, Viktor Klang wrote:
> Hey Bill,
>
> great write-up!
>
> While I agree that one should avoid negations in tests, I firmly believe
> that "shouldnt" is a way better syntax than "should not {}"
>
> Happy New Year!
>
> On Wed, Dec 31, 2008 at 3:54 AM, Warren Henning
> wrote:
>>
>> Coooool.
>>
>> Warren
>>
>> On Tue, Dec 30, 2008 at 5:50 PM, Bill Venners wrote:
>> > http://www.artima.com/weblogs/viewpost.jsp?thread=246279
>
>
>
> --
> Viktor Klang
> Senior Systems Analyst
>

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland