Skip to content

Exercise generator doesn't handle some expected values correctly  #195

Open
@BNAndras

Description

https://github.com/exercism/problem-specifications/blob/main/exercises/dnd-character/canonical-data.json

Execute (random ability is within range):
  let g:expected = "score >= 3 && score <= 18"
  AssertEqual g:expected, Ability()

Execute (random character is valid):
  let g:expected = {'constitution': 'constitution >= 3 && constitution <= 18', 'intelligence': 'intelligence >= 3 && intelligence <= 18', 'charisma': 'charisma >= 3 && charisma <= 18', 'hitpoints': 'hitpoints == 10 + modifier(constitution)', 'strength': 'strength >= 3 && strength <= 18', 'dexterity': 'dexterity >= 3 && dexterity <= 18', 'wisdom': 'wisdom >= 3 && wisdom <= 18'}
  AssertEqual g:expected, Character()

Execute (each ability is only calculated once):
  let g:expected = "strength == strength"
  AssertEqual g:expected, Strength()

The expected value is a dictionary containing a character's stats and then the validation for each one, and that's fairly different than the other exercises where the expected value is in fact the expected value from a calculation and not a description of it. I'm not really sure how this can be dealt with.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions