#include "mettle.hpp"
using namespace mettle;

suite<suites_list> test_suite("test suite", [](auto &_) {

  _.test("create a test suite", [](suites_list &suites) {
    suite<> inner("inner test suite", [](auto &_){
      _.test("inner test", []() {});
    }, suites);

    expect(suites, array(&inner));
  });

  _.test("create a test suite with fixture", [](suites_list &suites) {
    suite<int> inner("inner test suite", [](auto &_){
      _.test("inner test", [](int &) {});
    }, suites);

    expect(suites, array(&inner));
  });

  _.test("create a test suite that throws", [](suites_list &suites) {
    try {
      suite<int> inner("broken test suite", [](auto &){
        throw "bad";
      }, suites);
    } catch(...) {}

    expect(suites, array());
  });

});

#include "mettle.hpp"
using namespace mettle;

suite<suites_list> test_suite("test suite", [](auto &_) {

  _.test("create a test suite", [](suites_list &suites) {
    suite<> inner("inner test suite", [](auto &_){
      _.test("inner test", []() {});
    }, suites);

    expect(suites, array(&inner));
  });

  _.test("create a test suite with fixture", [](suites_list &suites) {
    suite<int> inner("inner test suite", [](auto &_){
      _.test("inner test", [](int &) {});
    }, suites);

    expect(suites, array(&inner));
  });

});

--- 
+++ 
@@ -19,4 +19,14 @@
     expect(suites, array(&inner));
   });
 
+  _.test("create a test suite that throws", [](suites_list &suites) {
+    try {
+      suite<int> inner("broken test suite", [](auto &){
+        throw "bad";
+      }, suites);
+    } catch(...) {}
+
+    expect(suites, array());
+  });
+
 });
Test that test suites with broken initializers don't get added to the list of suites
