Skip to content

Instantly share code, notes, and snippets.

@lshort
Created June 30, 2014 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lshort/844e25bfbbd6cce2d15d to your computer and use it in GitHub Desktop.
Save lshort/844e25bfbbd6cce2d15d to your computer and use it in GitHub Desktop.
Recursive expect_exception
auto show_fail = [] () { cout << "Caught Expected Exception..." << endl; };
auto show_err = [] (int ignore) { cout << "Failed to Catch Exception!!!"; };
auto fail1 = [z] () { graph_tests(z,'A','D', set<string>{"Topsort"});
return 1; };
expect_exception(fail1, true, show_fail, show_err );
auto fail2 = [x, none] () { graph_tests(x,'A','D', none); return 1; };
expect_exception(fail2, true, show_fail, show_err );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment