-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new string equality tests? #207
Comments
Yeah, I've also hit this issue when implementing my Java interpreter. I've decided to comply with the tests, but the spec needs to be updated, if the tests are correct. |
Interestingly enough, the old reference tests for this were different: https://github.com/RockstarLang/rockstar/blob/reference-implementation/tests/correct/operators/equalityComparison.rock#L33 and https://github.com/RockstarLang/rockstar/blob/reference-implementation/tests/correct/operators/equalityComparison.rock.out#L33 |
Yes, the tests are correct, the spec is out of date (and the older version of the test suite reflected the old behaviour) The thinking behind this is that a string such as
|
Are they correct?
I was updating the Kaiser-Ruby implementation with the new test suite and encountered this.
Spec says
String <op> Boolean => Convert the string to a boolean using all defined aliases.
, however the new test suite has tests like these:say "lies" is false
=>false
say "lies" is true
=>true
Which treat every string as truthy no matter what it contains.
Both my implementation and Maiden's online version convert the aliases, so the string can actually have a value and still be falsy for comparisons.
So, which behaviour is correct here?
The text was updated successfully, but these errors were encountered: