Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
description: don't mention null. strings are not null. null is when you DON'T have a string. which we do. that's already specified.
it has not been removed
and I have zero intuition telling me that spaces only are special in any way, that's a special case slapped on there and if you look at solutions, all it leads to is everyone writing the same code for it as a special case at the top of the function. it's functionally the same as a null check.
additionally the non-digit, non-space, non-alpha characters are unspecified and most of them are only tested in a single large test which is not all that fun to sift through, and the selection tested for seems arbitrary and incomplete.
epsilon of 1e-15 is used but is too small because that would be +-1 21st digit where a double only offers 15 or so
love seeing ai word salad in the comments
Other people don't know what "wrong" means. That word is relative to your expectations and observations, and you're not sharing those.
It checks equality, not integrity, whatever that is. And for primitives they do the same thing. And if it was wrong, then it wouldn't pass tests unless tests only tried even numbers ..
@Carl98K 0 and +0 evaluate to the same thing, you wouldn't be able to detect a difference as no difference exists between two of the same value. The problem is that your algorithm is flawed - you are reading from and writing to the same object without taking care to ensure that the writes don't affect the reads. Like peeing upstream and then getting it in your drinking water.
-0 would be another matter. that is a distinct value. but I don't think those are included.
no no no, not you. the test framework.
the Fork link is near the top
leftright corner of this pagewhat about line breaking the failure message so it's one over the other?
as the test framework should already be doing by default. why exactly have we still not had that changed?
that's not accurate. you're forking old code instead of the current code.I guess you figured it out
If you don't describe what the problem is so that others can see it, then you have not reported a problem. This is an invalid issue.
I understand, I forked it and tried to fix most of the problems without modifying the original too much, I think in the end it didn't work out very well
Fewer, but also all*, and deterministically so. (*though at most three different digits). They could be picked out and be randomly renamed again I suppose, if it's at risk of passing by fluke.
You've still got assertions outside
it
. The cw test framework really ought to error out on that, but it's made out of chewing gum. Assertions are only allowed init
,describe
is optionally used to groupit
's, similar to curly braces in C grouping statements.Additionally,
describe
may be nested, butit
may not.The
"Tricky Doubled!"
is .. still looking strange to me, because it'll produce:Which.. I don't know how to read that. It would also be nice if it stated what the input was, because printing it out is busy-work and sometimes confusing. Ideally I would have it read similar to:
or I suppose
which may be more convenient I just happen to disagree with that wording
I implemented your test cases, it seems reasonable, but it is generating a much larger amount of numbers that should be doubled, than tricky doubles, anyway
Loading more items...