exercism / vimscript

Exercism exercises in Vim script.
https://exercism.org/tracks/vimscript
MIT License
20 stars 24 forks source link

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

Open BNAndras opened 10 months ago

BNAndras commented 10 months ago

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.