Why is '{Hello}' not the same as '{Hello}' according to specs?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Why is '{Hello}' not the same as '{Hello}' according to specs?

Kenneth McDonald
Here's the output:

Macintosh-4:src Ken$ scala  NTreeSuite.scala
Specification "helloWorld"
   specifies
   + 'NTreeString("Hello").text' must be 'Hello'
   x Branch containing "Hello" must be "{Hello}"
     '{Hello}' is not the same as '{Hello}' ((virtual file):12)

Total for specification "helloWorld":
Finished in 0 second, 88 ms
2 examples, 2 assertions, 1 failure, 0 error

Code available upon request.

Thanks,
Ken
Reply | Threaded
Open this post in threaded view
|

Re: Why is '{Hello}' not the same as '{Hello}' according to specs?

Aaron Harnly-2-2
I've been led astray by that before.

What's happening is that you have two objects whose .toString yields  
the same string, but whose .equals returns false.

With a little more information we can maybe help you find out what's  
going on.
good luck,
Aaron

On Sep 13, 2008, at 8:32 PM, Kenneth McDonald wrote:

> Here's the output:
>
> Macintosh-4:src Ken$ scala  NTreeSuite.scala
> Specification "helloWorld"
>  specifies
>  + 'NTreeString("Hello").text' must be 'Hello'
>  x Branch containing "Hello" must be "{Hello}"
>    '{Hello}' is not the same as '{Hello}' ((virtual file):12)
>
> Total for specification "helloWorld":
> Finished in 0 second, 88 ms
> 2 examples, 2 assertions, 1 failure, 0 error
>
> Code available upon request.
>
> Thanks,
> Ken