Skip to content

allergies: Update json for new "input" policy #1033

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 1 commit into from
Dec 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 37 additions & 13 deletions exercises/allergies/canonical-data.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"exercise": "allergies",
"version": "1.0.0",
"version": "1.1.0",
"cases": [
{
"description": "allergicTo",
Expand All @@ -15,7 +15,9 @@
{
"description": "no allergies means not allergic",
"property": "allergicTo",
"score": 0,
"input": {
"score": 0
Copy link
Member

@rpottsoh rpottsoh Dec 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does "input" really need "score"? Why not just:

"input": 0,

Of course like changes for other cases. Unless we are really married to "score". Others should perhaps weigh in on this point.

Nevermind. @petertseng is right.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't care what y'all decide, but #996 (comment) and #996 (comment) are explicitly in favour of having "input": {"score": 0} not "input": 0 therefore that is the only thing I support in #998.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed that detail.

},
"expected": [
{
"substance": "peanuts",
Expand All @@ -34,7 +36,9 @@
{
"description": "is allergic to eggs",
"property": "allergicTo",
"score": 1,
"input": {
"score": 1
},
"expected": [
{
"substance": "eggs",
Expand All @@ -45,7 +49,9 @@
{
"description": "allergic to eggs in addition to other stuff",
"property": "allergicTo",
"score": 5,
"input": {
"score": 5
},
"expected": [
{
"substance": "eggs",
Expand All @@ -72,43 +78,57 @@
{
"description": "no allergies at all",
"property": "list",
"score": 0,
"input": {
"score": 0
},
"expected": []
},
{
"description": "allergic to just eggs",
"property": "list",
"score": 1,
"input": {
"score": 1
},
"expected": ["eggs"]
},
{
"description": "allergic to just peanuts",
"property": "list",
"score": 2,
"input": {
"score": 2
},
"expected": ["peanuts"]
},
{
"description": "allergic to just strawberries",
"property": "list",
"score": 8,
"input": {
"score": 8
},
"expected": ["strawberries"]
},
{
"description": "allergic to eggs and peanuts",
"property": "list",
"score": 3,
"input": {
"score": 3
},
"expected": ["eggs", "peanuts"]
},
{
"description": "allergic to more than eggs but not peanuts",
"property": "list",
"score": 5,
"input": {
"score": 5
},
"expected": ["eggs", "shellfish"]
},
{
"description": "allergic to lots of stuff",
"property": "list",
"score": 248,
"input": {
"score": 248
},
"expected": [ "strawberries",
"tomatoes",
"chocolate",
Expand All @@ -119,7 +139,9 @@
{
"description": "allergic to everything",
"property": "list",
"score": 255,
"input": {
"score": 255
},
"expected": [ "eggs",
"peanuts",
"shellfish",
Expand All @@ -133,7 +155,9 @@
{
"description": "ignore non allergen score parts",
"property": "list",
"score": 509,
"input": {
"score": 509
},
"expected": [ "eggs",
"shellfish",
"strawberries",
Expand Down