diff --git a/exercises/food-chain/canonical-data.json b/exercises/food-chain/canonical-data.json index 7945afcb94..fbc15b2876 100644 --- a/exercises/food-chain/canonical-data.json +++ b/exercises/food-chain/canonical-data.json @@ -1,185 +1,199 @@ { - "#": [ - "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." - ], - "verse": { - "description": "Return specified verse or series of verses", - "cases": [ - { - "description": "fly", - "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", - "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", - "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", - "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", - "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", - "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", - "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", - "start verse": 8, - "expected": [ - "I know an old lady who swallowed a horse.", - "She's dead, of course!" - ] - }, - { - "description": "multiple verses", - "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", - "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!" - ] - } - ] + "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." + ], + "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!" + ] + } + ] } + ] }