Missing/incomplete tests in exercise "Monster Attack"

Just a quick note to Elm track maintainers concerning the concept exercise “Monster Attack”, because the tests aren’t thorough enough:

attack1 : MonsterDamage -> MonsterDamage
attack1 monsterDamage =
    let
        kazakAttack = attackWithClaw1 "" 1
        annalynAttack = attackWithSword1 "" 5
    in
        String.concat
            [ annalynAttack
            , kazakAttack
            , kazakAttack
            , annalynAttack
            ]

This function passed, but it contains a bug that the elm analyzer caught: The variable monsterAttack was unused. The tests didn’t catch that, which should be fixed, I think.

For myself I simply added some string (“This is a previous attack.”) instead of empty strings to all the tests, like this:

tests =
    describe "MonsterAttack"
        [ describe "3"
            [ test "attack1 should attack with sword twice and claw twice" <|
                \_ ->
                    attack1 "This is a previous attack."
                        |> Expect.equal
                            "This is a previous attack.Attacked with sword of strength 5.Attacked with claw of strength 1.Attacked with claw of strength 1.Attacked with sword of strength 5."
            ]
        ]

This might be a bit too stupid and it might be confusing for students to find the unexpected “This is a previous attack.” string missing in their output.

That’s it :slight_smile:
Thanks for building all this stuff :+1:

Pinging those involved: @jiegillet @ceddlyburge

Hi DerTree, I think you meant monsterDamage in this statement, is that right?

It’s a good point, and we can take a look at updating the tests.

We welcome the creation of GitHub issues by the way!

Thanks!

Cedd

And pull requests!

Oh, ok, thanks for telling me! I did exactly that on other tracks and learned that both issues and PRs aren’t open anymore and are auto-closed because the maintenance burden for track maintainers has became a problem.
Happy to hear that this is not the case for Elm!

I’ll make some PRs for the uncontroversial small changes and issues if something is more complicated :+1:

Awesome, thanks!

I think some of the tracks were being overwhelmed with feedback, but the Elm track is probably a bit less popular, so the feedback is manageable!

1 Like

Thanks for honouring the forum-creation thing (and for your help in general)!

Just so you understand the issues vs forum thing, each track is tagged with either community-contributions-paused or community-contributions-accepted. Paused tracks have issues/PRs automatically closed. They’re ones with either no dedicated maintainers (where a forum chat often means something gets done by the wider maintainer community), or tracks that get overwhelmed by lower-quality issues/PRs.

(See the tag on the RHS of this screenshot)

For tracks that have them accepted, you can generally either use the forum or GitHub. Maintainers tend to have a personal preference (generally depending on how regularly they hang out here and how crazy their GH notifications are!) but either is considered ok from Exercism’s perspective :slight_smile: