{ "exercise": "food-chain", "version": "2.1.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": "recite", "input": { "startVerse": 1, "endVerse": 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": "recite", "input": { "startVerse": 2, "endVerse": 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": "recite", "input": { "startVerse": 3, "endVerse": 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": "recite", "input": { "startVerse": 4, "endVerse": 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": "recite", "input": { "startVerse": 5, "endVerse": 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": "recite", "input": { "startVerse": 6, "endVerse": 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": "recite", "input": { "startVerse": 7, "endVerse": 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": "recite", "input": { "startVerse": 8, "endVerse": 8 }, "expected": [ "I know an old lady who swallowed a horse.", "She's dead, of course!" ] }, { "description": "multiple verses", "property": "recite", "input": { "startVerse": 1, "endVerse": 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": "recite", "input": { "startVerse": 1, "endVerse": 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!" ] } ] } ] }