From bd8fc0c5d32e0a0d125e2944c3ef99b76ad6abe6 Mon Sep 17 00:00:00 2001 From: rbasso Date: Fri, 10 Mar 2017 18:36:43 +0900 Subject: [PATCH 1/2] food-chain: Make canonical-data.json compliant --- exercises/food-chain/canonical-data.json | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/exercises/food-chain/canonical-data.json b/exercises/food-chain/canonical-data.json index 7945afcb94..0d8cddf805 100644 --- a/exercises/food-chain/canonical-data.json +++ b/exercises/food-chain/canonical-data.json @@ -1,5 +1,7 @@ { - "#": [ + "exercise": "food-chain", + "version": "1.0.0", + "comments": [ "JSON doesn't allow for multi-line strings, so all verses are presented ", "here as arrays of strings. It's up to the test generator to join the ", "lines together with line breaks.", @@ -9,11 +11,13 @@ "implement the full song test and leave the rest alone, ignoring the start ", "and end verse fields." ], - "verse": { + "cases": [ + { "description": "Return specified verse or series of verses", "cases": [ { "description": "fly", + "property": "verse", "start verse": 1, "expected": [ "I know an old lady who swallowed a fly.", @@ -22,6 +26,7 @@ }, { "description": "spider", + "property": "verse", "start verse": 2, "expected": [ "I know an old lady who swallowed a spider.", @@ -32,6 +37,7 @@ }, { "description": "bird", + "property": "verse", "start verse": 3, "expected": [ "I know an old lady who swallowed a bird.", @@ -43,6 +49,7 @@ }, { "description": "cat", + "property": "verse", "start verse": 4, "expected": [ "I know an old lady who swallowed a cat.", @@ -55,6 +62,7 @@ }, { "description": "dog", + "property": "verse", "start verse": 5, "expected": [ "I know an old lady who swallowed a dog.", @@ -68,6 +76,7 @@ }, { "description": "goat", + "property": "verse", "start verse": 6, "expected": [ "I know an old lady who swallowed a goat.", @@ -82,6 +91,7 @@ }, { "description": "cow", + "property": "verse", "start verse": 7, "expected": [ "I know an old lady who swallowed a cow.", @@ -97,6 +107,7 @@ }, { "description": "horse", + "property": "verse", "start verse": 8, "expected": [ "I know an old lady who swallowed a horse.", @@ -105,6 +116,7 @@ }, { "description": "multiple verses", + "property": "verse", "start verse": 1, "end verse": 3, "expected": [ @@ -125,6 +137,7 @@ }, { "description": "full song", + "property": "verse", "start verse": 1, "end verse": 8, "expected": [ @@ -182,4 +195,5 @@ } ] } + ] } From 637cca615dbbb52d61d0a7a74d71c09360bdebf4 Mon Sep 17 00:00:00 2001 From: rbasso Date: Fri, 10 Mar 2017 18:38:03 +0900 Subject: [PATCH 2/2] food-chain: Fix canonical-data.json formatting --- exercises/food-chain/canonical-data.json | 380 +++++++++++------------ 1 file changed, 190 insertions(+), 190 deletions(-) diff --git a/exercises/food-chain/canonical-data.json b/exercises/food-chain/canonical-data.json index 0d8cddf805..fbc15b2876 100644 --- a/exercises/food-chain/canonical-data.json +++ b/exercises/food-chain/canonical-data.json @@ -2,198 +2,198 @@ "exercise": "food-chain", "version": "1.0.0", "comments": [ - "JSON doesn't allow for multi-line strings, so all verses are presented ", - "here as arrays of strings. It's up to the test generator to join the ", - "lines together with line breaks.", - "Some languages test for the verse() method, which takes a start verse ", - "and optional end verse, but other languages have only tested for the full poem.", - "For those languages in the latter category, you may wish to only ", - "implement the full song test and leave the rest alone, ignoring the start ", - "and end verse fields." - ], + "JSON doesn't allow for multi-line strings, so all verses are presented ", + "here as arrays of strings. It's up to the test generator to join the ", + "lines together with line breaks.", + "Some languages test for the verse() method, which takes a start verse ", + "and optional end verse, but other languages have only tested for the full poem.", + "For those languages in the latter category, you may wish to only ", + "implement the full song test and leave the rest alone, ignoring the start ", + "and end verse fields." + ], "cases": [ { - "description": "Return specified verse or series of verses", - "cases": [ - { - "description": "fly", - "property": "verse", - "start verse": 1, - "expected": [ - "I know an old lady who swallowed a fly.", - "I don't know why she swallowed the fly. Perhaps she'll die." - ] - }, - { - "description": "spider", - "property": "verse", - "start verse": 2, - "expected": [ - "I know an old lady who swallowed a spider.", - "It wriggled and jiggled and tickled inside her.", - "She swallowed the spider to catch the fly.", - "I don't know why she swallowed the fly. Perhaps she'll die." - ] - }, - { - "description": "bird", - "property": "verse", - "start verse": 3, - "expected": [ - "I know an old lady who swallowed a bird.", - "How absurd to swallow a bird!", - "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", - "She swallowed the spider to catch the fly.", - "I don't know why she swallowed the fly. Perhaps she'll die." - ] - }, - { - "description": "cat", - "property": "verse", - "start verse": 4, - "expected": [ - "I know an old lady who swallowed a cat.", - "Imagine that, to swallow a cat!", - "She swallowed the cat to catch the bird.", - "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", - "She swallowed the spider to catch the fly.", - "I don't know why she swallowed the fly. Perhaps she'll die." - ] - }, - { - "description": "dog", - "property": "verse", - "start verse": 5, - "expected": [ - "I know an old lady who swallowed a dog.", - "What a hog, to swallow a dog!", - "She swallowed the dog to catch the cat.", - "She swallowed the cat to catch the bird.", - "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", - "She swallowed the spider to catch the fly.", - "I don't know why she swallowed the fly. Perhaps she'll die." - ] - }, - { - "description": "goat", - "property": "verse", - "start verse": 6, - "expected": [ - "I know an old lady who swallowed a goat.", - "Just opened her throat and swallowed a goat!", - "She swallowed the goat to catch the dog.", - "She swallowed the dog to catch the cat.", - "She swallowed the cat to catch the bird.", - "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", - "She swallowed the spider to catch the fly.", - "I don't know why she swallowed the fly. Perhaps she'll die." - ] - }, - { - "description": "cow", - "property": "verse", - "start verse": 7, - "expected": [ - "I know an old lady who swallowed a cow.", - "I don't know how she swallowed a cow!", - "She swallowed the cow to catch the goat.", - "She swallowed the goat to catch the dog.", - "She swallowed the dog to catch the cat.", - "She swallowed the cat to catch the bird.", - "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", - "She swallowed the spider to catch the fly.", - "I don't know why she swallowed the fly. Perhaps she'll die." - ] - }, - { - "description": "horse", - "property": "verse", - "start verse": 8, - "expected": [ - "I know an old lady who swallowed a horse.", - "She's dead, of course!" - ] - }, - { - "description": "multiple verses", - "property": "verse", - "start verse": 1, - "end verse": 3, - "expected": [ - "I know an old lady who swallowed a fly.", - "I don't know why she swallowed the fly. Perhaps she'll die.", - "", - "I know an old lady who swallowed a spider.", - "It wriggled and jiggled and tickled inside her.", - "She swallowed the spider to catch the fly.", - "I don't know why she swallowed the fly. Perhaps she'll die.", - "", - "I know an old lady who swallowed a bird.", - "How absurd to swallow a bird!", - "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", - "She swallowed the spider to catch the fly.", - "I don't know why she swallowed the fly. Perhaps she'll die." - ] - }, - { - "description": "full song", - "property": "verse", - "start verse": 1, - "end verse": 8, - "expected": [ - "I know an old lady who swallowed a fly.", - "I don't know why she swallowed the fly. Perhaps she'll die.", - "", - "I know an old lady who swallowed a spider.", - "It wriggled and jiggled and tickled inside her.", - "She swallowed the spider to catch the fly.", - "I don't know why she swallowed the fly. Perhaps she'll die.", - "", - "I know an old lady who swallowed a bird.", - "How absurd to swallow a bird!", - "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", - "She swallowed the spider to catch the fly.", - "I don't know why she swallowed the fly. Perhaps she'll die.", - "", - "I know an old lady who swallowed a cat.", - "Imagine that, to swallow a cat!", - "She swallowed the cat to catch the bird.", - "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", - "She swallowed the spider to catch the fly.", - "I don't know why she swallowed the fly. Perhaps she'll die.", - "", - "I know an old lady who swallowed a dog.", - "What a hog, to swallow a dog!", - "She swallowed the dog to catch the cat.", - "She swallowed the cat to catch the bird.", - "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", - "She swallowed the spider to catch the fly.", - "I don't know why she swallowed the fly. Perhaps she'll die.", - "", - "I know an old lady who swallowed a goat.", - "Just opened her throat and swallowed a goat!", - "She swallowed the goat to catch the dog.", - "She swallowed the dog to catch the cat.", - "She swallowed the cat to catch the bird.", - "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", - "She swallowed the spider to catch the fly.", - "I don't know why she swallowed the fly. Perhaps she'll die.", - "", - "I know an old lady who swallowed a cow.", - "I don't know how she swallowed a cow!", - "She swallowed the cow to catch the goat.", - "She swallowed the goat to catch the dog.", - "She swallowed the dog to catch the cat.", - "She swallowed the cat to catch the bird.", - "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", - "She swallowed the spider to catch the fly.", - "I don't know why she swallowed the fly. Perhaps she'll die.", - "", - "I know an old lady who swallowed a horse.", - "She's dead, of course!" - ] - } - ] + "description": "Return specified verse or series of verses", + "cases": [ + { + "description": "fly", + "property": "verse", + "start verse": 1, + "expected": [ + "I know an old lady who swallowed a fly.", + "I don't know why she swallowed the fly. Perhaps she'll die." + ] + }, + { + "description": "spider", + "property": "verse", + "start verse": 2, + "expected": [ + "I know an old lady who swallowed a spider.", + "It wriggled and jiggled and tickled inside her.", + "She swallowed the spider to catch the fly.", + "I don't know why she swallowed the fly. Perhaps she'll die." + ] + }, + { + "description": "bird", + "property": "verse", + "start verse": 3, + "expected": [ + "I know an old lady who swallowed a bird.", + "How absurd to swallow a bird!", + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", + "She swallowed the spider to catch the fly.", + "I don't know why she swallowed the fly. Perhaps she'll die." + ] + }, + { + "description": "cat", + "property": "verse", + "start verse": 4, + "expected": [ + "I know an old lady who swallowed a cat.", + "Imagine that, to swallow a cat!", + "She swallowed the cat to catch the bird.", + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", + "She swallowed the spider to catch the fly.", + "I don't know why she swallowed the fly. Perhaps she'll die." + ] + }, + { + "description": "dog", + "property": "verse", + "start verse": 5, + "expected": [ + "I know an old lady who swallowed a dog.", + "What a hog, to swallow a dog!", + "She swallowed the dog to catch the cat.", + "She swallowed the cat to catch the bird.", + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", + "She swallowed the spider to catch the fly.", + "I don't know why she swallowed the fly. Perhaps she'll die." + ] + }, + { + "description": "goat", + "property": "verse", + "start verse": 6, + "expected": [ + "I know an old lady who swallowed a goat.", + "Just opened her throat and swallowed a goat!", + "She swallowed the goat to catch the dog.", + "She swallowed the dog to catch the cat.", + "She swallowed the cat to catch the bird.", + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", + "She swallowed the spider to catch the fly.", + "I don't know why she swallowed the fly. Perhaps she'll die." + ] + }, + { + "description": "cow", + "property": "verse", + "start verse": 7, + "expected": [ + "I know an old lady who swallowed a cow.", + "I don't know how she swallowed a cow!", + "She swallowed the cow to catch the goat.", + "She swallowed the goat to catch the dog.", + "She swallowed the dog to catch the cat.", + "She swallowed the cat to catch the bird.", + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", + "She swallowed the spider to catch the fly.", + "I don't know why she swallowed the fly. Perhaps she'll die." + ] + }, + { + "description": "horse", + "property": "verse", + "start verse": 8, + "expected": [ + "I know an old lady who swallowed a horse.", + "She's dead, of course!" + ] + }, + { + "description": "multiple verses", + "property": "verse", + "start verse": 1, + "end verse": 3, + "expected": [ + "I know an old lady who swallowed a fly.", + "I don't know why she swallowed the fly. Perhaps she'll die.", + "", + "I know an old lady who swallowed a spider.", + "It wriggled and jiggled and tickled inside her.", + "She swallowed the spider to catch the fly.", + "I don't know why she swallowed the fly. Perhaps she'll die.", + "", + "I know an old lady who swallowed a bird.", + "How absurd to swallow a bird!", + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", + "She swallowed the spider to catch the fly.", + "I don't know why she swallowed the fly. Perhaps she'll die." + ] + }, + { + "description": "full song", + "property": "verse", + "start verse": 1, + "end verse": 8, + "expected": [ + "I know an old lady who swallowed a fly.", + "I don't know why she swallowed the fly. Perhaps she'll die.", + "", + "I know an old lady who swallowed a spider.", + "It wriggled and jiggled and tickled inside her.", + "She swallowed the spider to catch the fly.", + "I don't know why she swallowed the fly. Perhaps she'll die.", + "", + "I know an old lady who swallowed a bird.", + "How absurd to swallow a bird!", + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", + "She swallowed the spider to catch the fly.", + "I don't know why she swallowed the fly. Perhaps she'll die.", + "", + "I know an old lady who swallowed a cat.", + "Imagine that, to swallow a cat!", + "She swallowed the cat to catch the bird.", + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", + "She swallowed the spider to catch the fly.", + "I don't know why she swallowed the fly. Perhaps she'll die.", + "", + "I know an old lady who swallowed a dog.", + "What a hog, to swallow a dog!", + "She swallowed the dog to catch the cat.", + "She swallowed the cat to catch the bird.", + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", + "She swallowed the spider to catch the fly.", + "I don't know why she swallowed the fly. Perhaps she'll die.", + "", + "I know an old lady who swallowed a goat.", + "Just opened her throat and swallowed a goat!", + "She swallowed the goat to catch the dog.", + "She swallowed the dog to catch the cat.", + "She swallowed the cat to catch the bird.", + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", + "She swallowed the spider to catch the fly.", + "I don't know why she swallowed the fly. Perhaps she'll die.", + "", + "I know an old lady who swallowed a cow.", + "I don't know how she swallowed a cow!", + "She swallowed the cow to catch the goat.", + "She swallowed the goat to catch the dog.", + "She swallowed the dog to catch the cat.", + "She swallowed the cat to catch the bird.", + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.", + "She swallowed the spider to catch the fly.", + "I don't know why she swallowed the fly. Perhaps she'll die.", + "", + "I know an old lady who swallowed a horse.", + "She's dead, of course!" + ] + } + ] } ] }