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.
Hi, could you take a look at the issue Awesome opened about the rust translation, please?
Looks like it's good to go? Did I miss anything in the wall of text below?
Right, sounds good then.
Are you talking about the use of
self
in the properties/getters/fields section of the spec? I was usingself
for consistency with the spec in all the other languages which use self/this.As far as seeing
self
in other languages that don't have it, theself.___
listings are all in language-conditional blocks, so they will only show in rust. (In fact, each of those listings has a conditional block for each language the kata supports, with each listing using self/this.)ok, just forget about the global TRACE thing, keep it at True in the tests.
I'm not competent anymore for the other stuff, so just poke at me when the translation is ready for approval.
NOTE: for an unknown reason, I don't receive any notification anymore when a message is posted here, so when done or if some context is needed plz poke at me on discord.
Cheers
Note: you can use
assert!
with a custom comparison as first argument (e.g. compare actual to expected), and a fully custom assertion message as second argument. This doesn't output the boilerplate "left == right" stuff that you get withassert_eq!
, only your own assertion message.I think replacing
self
withatom
would be more sensible (not all languages have the notion ofself
being the instance, some havethis
, others might not have that concept at all?). It should be clear thatatom
would then be referring to an instance of the Atom type, since that is mentioned in the text directly above.1.Unfortunately not, there's some magic that
assert_eq!
does that is difficult to replicate.assert_eq!
is also the standard for writing tests anyway, so adding an error message should be enough for your average rust programmer.4.I guess it would be possible, but very ugly and not at all idiomatic. It is not uncommon for tests in the wild to always output a stdout trace, because the compiler and package manager is configured to conditionally block stdout depending on the results of tests and how many are being run. (I think the rust way to solve this problem is set TRACE to true, and let the compiler do the rest.)
Note: I renamed
nice_assert_eq
to bechem_assert
because I keep overloading it with common functionality (checking lists of test strs, checking for errs, etc.)ok, code used in python:
ok, sounds good to me.
.1 => I still see some left/right, as in:
Would that be possible to have actual/expected (or the opposite, I didn't check which one it is) instead of left/right everywhere?
.3 => yeah, good idea. I'll update the other languages.
.4 => about the TRACE thing, the idea is that the user can change the setting through their solution, to help debugging. I didn't see it defined in there or in preloaded => ?
Everything else seems fine to me.
Cheers!
I took a (minimally-invasive) swing at it. Let me know if there's anything else to be done.
That worked - thanks!
try this link
Thanks, it was a good challenge! I use your translations all the time, so the shout out means a lot.
That's a good tip about shifting the
mod preloaded
into the test suite - change published!Sure! How do I get on to the discord? The links don't appear to work... :(
Loading more items...