Sha256: c1981f44e3d0197c3a3f23be12240ef10dc8d2e6f0ce8771e4c8c1880c7c6dc2

Contents?: true

Size: 912 Bytes

Versions: 2

Compression:

Stored size: 912 Bytes

Contents

#include <snowhouse/snowhouse.h>
using namespace snowhouse;
#include "tests.h"

void ExpressionErrorHandling()
{
  std::cout << "================================================" << std::endl;
  std::cout << "   ExpressionErrorHandling" << std::endl;
  std::cout << "================================================" << std::endl;

  std::vector<int> collection;
  collection.push_back(1);
  collection.push_back(2);
  collection.push_back(3);
  
  std::cout << "AnInvalidAllOperationShouldBeReportedProperly" << std::endl;
  {
    AssertTestFails(Assert::That(collection, Has().All()), 
        "The expression after \"all\" operator does not yield any result");
  }
  
  std::cout << "AnInvalidAtLeastOperationShouldBeReportedProperly" << std::endl;
  {
    AssertTestFails(Assert::That(collection, Has().AtLeast(2)),
        "The expression after \"at least 2\" operator does not yield any result");
  }
  
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tree-sitter-0.1.0 ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/example/expression_error_handling.cpp
tree-sitter-0.0.1 ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/example/expression_error_handling.cpp