Skip to content
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
378 changes: 196 additions & 182 deletions exercises/food-chain/canonical-data.json
Original file line number Diff line number Diff line change
@@ -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!"
]
}
]
}
]
}