The Artima Developer Community
Sponsored Link

ScalaTest/ScalaUtils Forum
negate of ===?

3 replies on 1 page. Most recent reply: Aug 20, 2008 7:18 AM by Bill Venners

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Zemian Deng

Posts: 49
Nickname: zdeng
Registered: Jan, 2008

negate of ===? Posted: Aug 11, 2008 9:12 PM
Reply to this message Reply
Advertisement
Hi there,
I don't see !== available. How would I do that in scalatest and see error for both side values been compared if they do matched?


Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: negate of ===? Posted: Aug 17, 2008 4:00 PM
Reply to this message Reply
Hi Zemian,

I actually had that in the first release I think, but I took it out because I found I was never using it. I wanted to try and keep things as simple as possible until people actually requested the features. Right now, you need to just do it with != and add a string comment:


assert(a != b, a +" equaled "+ b)

Zemian Deng

Posts: 49
Nickname: zdeng
Registered: Jan, 2008

Re: negate of ===? Posted: Aug 17, 2008 6:32 PM
Reply to this message Reply
Seems useful to me that I don't have to keep typing the text where I just want the value to show when it fail the test.

When you said keep it simple, adding more methods doesn't seem complicated things to me. If user don't use it, it's not going to bother right?

-Z

Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: negate of ===? Posted: Aug 20, 2008 7:18 AM
Reply to this message Reply
> Seems useful to me that I don't have to keep typing the
> text where I just want the value to show when it fail the
> test.
>
> When you said keep it simple, adding more methods doesn't
> seem complicated things to me. If user don't use it, it's
> not going to bother right?
>
Well every method I add to the API adds surface area that users have to climb over to find what they are looking for. It adds more to read in the documentation, more to remember when you're using the API, more to try to figure out when looking at someone else's code. So I'd prefer to add the ones that hit the 80/20 rule--especially when it comes to adding operators--and I'm not sure how much !== would actually be used. Can you let me know what kind of use cases you use it for?

Thanks.

Bill

Flat View: This topic has 3 replies on 1 page
Topic: Scala Source Code Previous Topic   Next Topic Topic: is scalatest still active?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use