예제 #1
0
  def test_example_1(self):
    available = ["ham", "cheese", "mustard"]
    order = ["ham cheese"]
    value = which_order(available, order)

    self.assertEqual(value, 0)
예제 #2
0
  def test_example_3(self):
    available = [ "cheese", "cheese", "cheese", "tomato" ]
    order = [ "ham ham ham", "water", "pork", "bread", "cheese tomato cheese", "beef" ]
    value = which_order(available, order)

    self.assertEqual(value, 4)
예제 #3
0
  def test_example_4(self):
    available = [ "foo", "bar", "baz", "gazonk", "quux", "bat", "xyzzy", "shme", "hukarz", "grault", "waldo", "bleh" ]
    order = [ "kalatehas", "spam eggs", "needle haystack", "bleh blarg", "plugh", "the best sandwich in the universe" ]
    value = which_order(available, order)

    self.assertEqual(value, -1)
예제 #4
0
  def test_example_2(self):
    available = ["cheese", "mustard", "lettuce"]
    order = ["cheese ham", "cheese mustard lettuce", "ketchup", "beer"]
    value = which_order(available, order)

    self.assertEqual(value, 1)