On Sun, Oct 6, 2019 at 11:10 AM The Living Cosmos <[email protected]> wrote:
> > A few days ago someone posted a [coding challenge]( > https://www.reddit.com/r/Python/comments/dd1efi/im_on_a_mission_to_explain_all_popular_coding/) > > This is a silly, made up problem, which doesn't tell you much about a candidate, but let's ignore that :-) It's also a very easy (but presumably tricky) problem, because it is completely self contained. For such problems, you can, and should, start with unit tests. In Leo, here is the gist: 1. Create an @test node. 2. Within that node, create a table of inputs and expected outputs. 3. For each entry in the table, assert that the expected output matches the output of your code. For a really simple problem like that, you can define the code in the @test node :-) There are lots of unit tests like this in unitTest.leo. HTH. Edward ------------------------------------------------------------------------------------------ Edward K. Ream: [email protected] Leo: http://leoeditor.com/ ------------------------------------------------------------------------------------------ -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAMF8tS03a4CBrUY%2BskAo%3D45z2D6vnB2n_4RayGbCiGR%2Bt%3DeocA%40mail.gmail.com.
