Skip to content

Instantly share code, notes, and snippets.

@banister
Created June 17, 2011 13:16
Show Gist options
  • Save banister/1031398 to your computer and use it in GitHub Desktop.
Save banister/1031398 to your computer and use it in GitHub Desktop.
int main(int argc, char *argv[]) {
TestDefaultFormatter formatter;
use_formatter(formatter);
describe("Test", []{
it("1 == 1", []{ assert(1).equals(1); });
it("2 == 1", []{ assert(2).equals(1); });
describe("with strings", []{
it("std::string == char*", []{ assert_equals(std::string("a"), "a"); });
it("char* == char*", []{ assert_equals("a", "a"); });
});
it("can catch exceptions", []{
assert_raises(std::string, []{
throw std::string("test");
});
});
});
run_tests();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment