Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
BNAndras opened this issue Nov 7, 2023 · 0 comments
Open

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

BNAndras opened this issue Nov 7, 2023 · 0 comments

Comments

@BNAndras
Copy link
Member

BNAndras commented Nov 7, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant