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
127 changes: 116 additions & 11 deletions exercises/practice/food-chain/food_chain.vader
Original file line number Diff line number Diff line change
@@ -1,60 +1,165 @@

Execute (fly):
let g:endVerse = 1
let g:startVerse = 1
let g:expected = ['I know an old lady who swallowed a fly.', 'I don''t know why she swallowed the fly. Perhaps she''ll die.']
let g:expected = [
\ "I know an old lady who swallowed a fly.",
\ "I don't know why she swallowed the fly. Perhaps she'll die."]
AssertEqual g:expected, Recite(g:endVerse, g:startVerse)

Execute (spider):
let g:endVerse = 2
let g:startVerse = 2
let g: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.']
let g: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."]
AssertEqual g:expected, Recite(g:endVerse, g:startVerse)

Execute (bird):
let g:endVerse = 3
let g:startVerse = 3
let g: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.']
let g: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."]
AssertEqual g:expected, Recite(g:endVerse, g:startVerse)

Execute (cat):
let g:endVerse = 4
let g:startVerse = 4
let g: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.']
let g: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."]
AssertEqual g:expected, Recite(g:endVerse, g:startVerse)

Execute (dog):
let g:endVerse = 5
let g:startVerse = 5
let g: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.']
let g: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."]
AssertEqual g:expected, Recite(g:endVerse, g:startVerse)

Execute (goat):
let g:endVerse = 6
let g:startVerse = 6
let g: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.']
let g: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."]
AssertEqual g:expected, Recite(g:endVerse, g:startVerse)

Execute (cow):
let g:endVerse = 7
let g:startVerse = 7
let g: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.']
let g: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."]
AssertEqual g:expected, Recite(g:endVerse, g:startVerse)

Execute (horse):
let g:endVerse = 8
let g:startVerse = 8
let g:expected = ['I know an old lady who swallowed a horse.', 'She''s dead, of course!']
let g:expected = [
\ "I know an old lady who swallowed a horse.",
\ "She's dead, of course!"]
AssertEqual g:expected, Recite(g:endVerse, g:startVerse)

Execute (multiple verses):
let g:endVerse = 3
let g:startVerse = 1
let g: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.']
let g: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."]
AssertEqual g:expected, Recite(g:endVerse, g:startVerse)

Execute (full song):
let g:endVerse = 8
let g:startVerse = 1
let g: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!']
let g: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!"]
AssertEqual g:expected, Recite(g:endVerse, g:startVerse)