Compare the result and expected output of a test that has been run

 test - A Test object that has been run
 precondition :: expected_exists?(test) is true

 Returns success or failure as a symbol
192457
def cmp_output(test)
      # test out and err
      if test.expected_out_exists? && test.expected_err_exists?
        cmp_out(test)
        cmp_err(test)
        return :success if (test.out_result && test.err_result)

      # test only out
      elsif test.expected_out_exists?
        cmp_out(test)
        return :success if test.out_result

      # test only err
      else
        cmp_err(test)
        return :success if test.err_result
      end

      return :failed
    end
47384
def check_exists(required, input)
      required.inject(true) do |result, key|
        input[key] && result
      end
    end
233240
def assert_results_contain(check_results, expected_status, expected_msgcode=None):
  
  found = False
  for status, message in check_results:
    if status == expected_status and message.code == expected_msgcode:
      found = True
      break
  assert(found)
1006605
def assert_not_equal(self, actual_val, unexpected_val, failure_message='Expected values to differ: "{}" and "{}"'):
        
        assertion = lambda: unexpected_val != actual_val
        self.webdriver_assert(assertion, unicode(failure_message).format(actual_val, unexpected_val))
179733
def assert_equals(self, actual_val, expected_val, failure_message='Expected values to be equal: "{}" and "{}"'):
        
        assertion = lambda: expected_val == actual_val
        self.webdriver_assert(assertion, unicode(failure_message).format(actual_val, expected_val))
365261
def result
      if @cache[:checks].new_objects?
        @cache[:checks].stored_objects.each do |c|
          @result = Result.new(c.sample) unless c.success?
        end
      end

      @result
    end
1202176
def evaluate(actual, expected)
      if actual.respond_to?(expected)
        pass(new_message.responds_to(expected))
      else
        fail(expected_message.method(expected).is_not_defined)
      end
    end
262179
public static Boolean exists(
            EvaluationContext ctx,
            Object tests,
            Object target) {

        if (!(tests instanceof List)) {
            if (tests == null) {
                ctx.notifyEvt(() -> new ASTEventBase(FEELEvent.Severity.ERROR, Msg.createMessage(Msg.IS_NULL, "value"), null));
                return null;
            }
            return applyUnaryTest(ctx, tests, target);
        }

        for (Object test : (List) tests) {
            Boolean r = applyUnaryTest(ctx, test, target);
            if (Boolean.TRUE.equals(r)) {
                return true;
            }
        }

        return false;
    }
1284678
def evaluate(actual)
      actual.empty? ? pass(new_message.is_empty) : fail(expected_message(actual).to_be_empty)
    end
98949
function (/*util*/) {

      function compare(actual, expected) {
        return {
          pass: actual instanceof Error && ('' + actual).indexOf(expected) >= 0
        }
      }

      return {compare: compare}
    }
1269907
def evaluate(actual, *expectings)
      prepare(actual, *expectings) do |variable, expected_value, actual_value|
        if actual_value.nil?
          fail expected_message(variable).to_be_assigned_a_value
        elsif !expected_value.nil? && expected_value != actual_value
          fail expected_message(variable).to_be_assigned_with(expected_value).not(actual_value)
        else
          if expected_value && actual_value
            pass new_message.assigns(variable).with(expected_value)
          else
            pass new_message.assigns(variable)
          end
        end
      end
    end
742465
function assertStd (result, std) {
    var message = 'Expected value to match following regexp: ' + std + ', but got: ' + result;

    if (typeof std === 'string' || typeof std === 'number') {
      assert.equal(result && result.code || result, std);
    }
    else if (std instanceof RegExp) {
      assert.isNotNull(result.match(std), message);
    }
    else if (typeof std === 'function') {
      assert.ok(std(result));
    }
    else if (typeof result !== 'string' && result !== null) {
      assert.equal(result.code, 0);
    }
  }
244958
def verify(self):
        
        for expectation in self.exp_list:
            if hasattr(expectation, "verify") and not expectation.verify():
                return False
        return True
945408
def run(self, data):
        
        result_type = namedtuple('Result', 'code messages')

        if self.passes is True:
            result = result_type(Checker.Code.PASSED, '')
        elif self.passes is False:
            if self.allow_failure:
                result = result_type(Checker.Code.IGNORED, '')
            else:
                result = result_type(Checker.Code.FAILED, '')
        else:
            try:
                result = self.check(data, **self.arguments)
                messages = ''
                if isinstance(result, tuple):
                    result, messages = result

                if result not in Checker.Code:
                    result = Checker.Code.PASSED if bool(result) else Checker.Code.FAILED

                if result == Checker.Code.FAILED and self.allow_failure:
                    result = Checker.Code.IGNORED

                result = result_type(result, messages)
            except NotImplementedError:
                result = result_type(Checker.Code.NOT_IMPLEMENTED, '')
        self.result = result
309723
def check_result(running, recurse=False, highstate=None):
    '''
    
    '''
    if not isinstance(running, dict):
        return False

    if not running:
        return False

    ret = True
    for state_id, state_result in six.iteritems(running):
        expected_type = dict
        # The __extend__ state is a list
        if "__extend__" == state_id:
            expected_type = list
        if not recurse and not isinstance(state_result, expected_type):
            ret = False
        if ret and isinstance(state_result, dict):
            result = state_result.get('result', _empty)
            if result is False:
                ret = False
            # only override return value if we are not already failed
            elif result is _empty and isinstance(state_result, dict) and ret:
                ret = check_result(
                    state_result, recurse=True, highstate=highstate)
        # if we detect a fail, check for onfail requisites
        if not ret:
            # ret can be None in case of no onfail reqs, recast it to bool
            ret = bool(check_onfail_requisites(state_id, state_result,
                                               running, highstate))
        # return as soon as we got a failure
        if not ret:
            break
    return ret
149888
def assert_received(mock, expected_method_name)
      matcher = have_received(expected_method_name)
      yield(matcher) if block_given?
      assert matcher.matches?(mock), matcher.failure_message
    end
493738
def evaluate(actual)
      warn "any is deprecated; please use asserts.empty or denies.empty instead"
      any?(actual) ? pass("has items") : fail(expected_message(actual).to_have_items)
    end