title: Check Line Passes Origin
signature: function check_line_passes_origin(x1, y1, x2, y2)
source_py: def check_line_passes_origin(x1, y1, x2, y2):
      return ((x1 * (y2 - y1)) == (y1 * (x2 - x1)))
source_cpp: bool check_line_passes_origin(int x1, int y1, int x2, int y2) {
    return ( x1 * ( y2 - y1 ) == y1 * ( x2 - x1 ) );
  }
question_info.entry_fn_name: check_line_passes_origin
question_info.entry_cls_name: Solution
question_info.test_case_ids: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
question_info.test_code: 
  
  -- SOLUTION CODE
  -- ============================================
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  function isCorrect(actual, expected)
      if type(expected) ~= type(actual) then
          return false
      end
      
      if type(expected) == 'table' then
          for k,v_expected in pairs(expected) do
              
              if actual[k] == nil then
                  return false
              end
              local v_actual = actual[k]
              if not isCorrect(v_actual, v_expected) then
                  return false
              end
              actual[k]=nil
          end
      
          if next(actual) then 
              return false
          end
          return true
      else
          return actual == expected
      end
  end
  
  function validateSolution(actual, expected)
      return isCorrect(actual,expected)
  end
  
  function driver(x1, y1, x2, y2, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(x1, y1, x2, y2) 
      end)
      if status then
          if validateSolution(exec_result,expected) then
              return "PASSED"
          end
          return "FAILED"
      else
          return string.format("ERROR=%s",string.gsub(error_msg,".*:[%d]+: ",""))
      end
  end
      
  function main()
      result = driver(1, 28, 2, 56, true)
      print(string.format("TEST-0...%s",result))
  
      result = driver(10, 0, 20, 0, true)
      print(string.format("TEST-1...%s",result))
  
      result = driver(0, 1, 0, 17, true)
      print(string.format("TEST-2...%s",result))
  
      result = driver(1, 1, 10, 10, true)
      print(string.format("TEST-3...%s",result))
  
      result = driver(82, 86, 19, 4, false)
      print(string.format("TEST-4...%s",result))
  
      result = driver(78, 86, 11, 6, false)
      print(string.format("TEST-5...%s",result))
  
      result = driver(13, 46, 33, 33, false)
      print(string.format("TEST-6...%s",result))
  
      result = driver(18, 29, 95, 12, false)
      print(string.format("TEST-7...%s",result))
  
      result = driver(42, 35, 25, 36, false)
      print(string.format("TEST-8...%s",result))
  
      result = driver(29, 17, 45, 35, false)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
question_info.test_list: [{"idx": 0, "outputs": true, "inputs": {"x1": 1, "y1": 28, "x2": 2, "y2": 56}}, {"idx": 1, "outputs": true, "inputs": {"x1": 10, "y1": 0, "x2": 20, "y2": 0}}, {"idx": 2, "outputs": true, "inputs": {"x1": 0, "y1": 1, "x2": 0, "y2": 17}}, {"idx": 3, "outputs": true, "inputs": {"x1": 1, "y1": 1, "x2": 10, "y2": 10}}, {"idx": 4, "outputs": false, "inputs": {"x1": 82, "y1": 86, "x2": 19, "y2": 4}}, {"idx": 5, "outputs": false, "inputs": {"x1": 78, "y1": 86, "x2": 11, "y2": 6}}, {"idx": 6, "outputs": false, "inputs": {"x1": 13, "y1": 46, "x2": 33, "y2": 33}}, {"idx": 7, "outputs": false, "inputs": {"x1": 18, "y1": 29, "x2": 95, "y2": 12}}, {"idx": 8, "outputs": false, "inputs": {"x1": 42, "y1": 35, "x2": 25, "y2": 36}}, {"idx": 9, "outputs": false, "inputs": {"x1": 29, "y1": 17, "x2": 45, "y2": 35}}]