-
-
Notifications
You must be signed in to change notification settings - Fork 554
allergies: Make exercise schema-compliant #628
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,149 @@ | ||
{ | ||
"allergic_to": { | ||
"description": [ | ||
"Given a number and a substance, indicate whether Tom is allergic ", | ||
"to that substance.", | ||
"Test cases for this method involve more than one assertion.", | ||
"Each case in 'expected' specifies what the method should return for", | ||
"the given substance." | ||
], | ||
"cases": [ | ||
"exercise": "allergies", | ||
"version": "1.0.0", | ||
"cases": [ | ||
{ | ||
"description": "allergicTo", | ||
"comments": [ | ||
"Given a number and a substance, indicate whether Tom is allergic ", | ||
"to that substance.", | ||
"Test cases for this method involve more than one assertion.", | ||
"Each case in 'expected' specifies what the method should return for", | ||
"the given substance." | ||
], | ||
"cases": [ | ||
{ | ||
"description": "no allergies means not allergic", | ||
"property": "allergicTo", | ||
"score": 0, | ||
"expected": [ | ||
{ | ||
"description": "no allergies means not allergic", | ||
"score": 0, | ||
"expected": [ | ||
{ | ||
"substance": "peanuts", | ||
"result": false | ||
}, | ||
{ | ||
"substance": "cats", | ||
"result": false | ||
}, | ||
{ | ||
"substance": "strawberries", | ||
"result": false | ||
} | ||
] | ||
"substance": "peanuts", | ||
"result": false | ||
}, | ||
{ | ||
"description": "is allergic to eggs", | ||
"score": 1, | ||
"expected": [ | ||
{ | ||
"substance": "eggs", | ||
"result": true | ||
} | ||
] | ||
"substance": "cats", | ||
"result": false | ||
}, | ||
{ | ||
"description": "allergic to eggs in addition to other stuff", | ||
"score": 5, | ||
"expected": [ | ||
{ | ||
"substance": "eggs", | ||
"result": true | ||
}, | ||
{ | ||
"substance": "shellfish", | ||
"result": true | ||
}, | ||
{ | ||
"substance": "strawberries", | ||
"result": false | ||
} | ||
] | ||
"substance": "strawberries", | ||
"result": false | ||
} | ||
] | ||
}, | ||
"list": { | ||
"description": ["Given a number, list all things Tom is allergic to"], | ||
"cases": [ | ||
{ | ||
"description": "no allergies at all", | ||
"score": 0, | ||
"expected": [] | ||
}, | ||
{ | ||
"description": "allergic to just eggs", | ||
"score": 1, | ||
"expected": ["eggs"] | ||
}, | ||
{ | ||
"description": "allergic to just peanuts", | ||
"score": 2, | ||
"expected": ["peanuts"] | ||
}, | ||
] | ||
}, | ||
{ | ||
"description": "is allergic to eggs", | ||
"property": "allergicTo", | ||
"score": 1, | ||
"expected": [ | ||
{ | ||
"description": "allergic to just strawberries", | ||
"score": 8, | ||
"expected": ["strawberries"] | ||
}, | ||
{ | ||
"description": "allergic to eggs and peanuts", | ||
"score": 3, | ||
"expected": ["eggs", "peanuts"] | ||
}, | ||
{ | ||
"description": "allergic to more than eggs but not peanuts", | ||
"score": 5, | ||
"expected": ["eggs", "shellfish"] | ||
}, | ||
"substance": "eggs", | ||
"result": true | ||
} | ||
] | ||
}, | ||
{ | ||
"description": "allergic to eggs in addition to other stuff", | ||
"property": "allergicTo", | ||
"score": 5, | ||
"expected": [ | ||
{ | ||
"description": "allergic to lots of stuff", | ||
"score": 248, | ||
"expected": ["strawberries", "tomatoes", "chocolate", "pollen", "cats"] | ||
"substance": "eggs", | ||
"result": true | ||
}, | ||
{ | ||
"description": "allergic to everything", | ||
"score": 255, | ||
"expected": ["eggs", "peanuts", "shellfish", "strawberries", "tomatoes", "chocolate", "pollen", "cats"] | ||
"substance": "shellfish", | ||
"result": true | ||
}, | ||
{ | ||
"description": "ignore non allergen score parts", | ||
"score": 509, | ||
"expected": ["eggs", "shellfish", "strawberries", "tomatoes", "chocolate", "pollen", "cats"] | ||
"substance": "strawberries", | ||
"result": false | ||
} | ||
] | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"description": "list", | ||
"comments": [ | ||
"Given a number, list all things Tom is allergic to" | ||
], | ||
"cases": [ | ||
{ | ||
"description": "no allergies at all", | ||
"property": "list", | ||
"score": 0, | ||
"expected": [] | ||
}, | ||
{ | ||
"description": "allergic to just eggs", | ||
"property": "list", | ||
"score": 1, | ||
"expected": ["eggs"] | ||
}, | ||
{ | ||
"description": "allergic to just peanuts", | ||
"property": "list", | ||
"score": 2, | ||
"expected": ["peanuts"] | ||
}, | ||
{ | ||
"description": "allergic to just strawberries", | ||
"property": "list", | ||
"score": 8, | ||
"expected": ["strawberries"] | ||
}, | ||
{ | ||
"description": "allergic to eggs and peanuts", | ||
"property": "list", | ||
"score": 3, | ||
"expected": ["eggs", "peanuts"] | ||
}, | ||
{ | ||
"description": "allergic to more than eggs but not peanuts", | ||
"property": "list", | ||
"score": 5, | ||
"expected": ["eggs", "shellfish"] | ||
}, | ||
{ | ||
"description": "allergic to lots of stuff", | ||
"property": "list", | ||
"score": 248, | ||
"expected": [ "strawberries", | ||
"tomatoes", | ||
"chocolate", | ||
"pollen", | ||
"cats" | ||
] | ||
}, | ||
{ | ||
"description": "allergic to everything", | ||
"property": "list", | ||
"score": 255, | ||
"expected": [ "eggs", | ||
"peanuts", | ||
"shellfish", | ||
"strawberries", | ||
"tomatoes", | ||
"chocolate", | ||
"pollen", | ||
"cats" | ||
] | ||
}, | ||
{ | ||
"description": "ignore non allergen score parts", | ||
"property": "list", | ||
"score": 509, | ||
"expected": [ "eggs", | ||
"shellfish", | ||
"strawberries", | ||
"tomatoes", | ||
"chocolate", | ||
"pollen", | ||
"cats" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I misreading the spec, or doesn't
comments
go at the top level?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can have comments in the top level, in a test group, or inside a test, so that people can keep them where they fit better. In this case, it is in the test group because it pertains just that group of test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, thanks