From 062cd07342edc2b003555e90dd2cee0514b9f64a Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Mon, 23 Feb 2015 09:11:55 +0100 Subject: Add BanditCpp 1.1.4 test harness --- .../failure_formatters/default_formatter.spec.cpp | 21 +++++++++++++++++++++ .../visual_studio_failure_formatter.spec.cpp | 22 ++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 vendor/bandit/specs/failure_formatters/default_formatter.spec.cpp create mode 100644 vendor/bandit/specs/failure_formatters/visual_studio_failure_formatter.spec.cpp (limited to 'vendor/bandit/specs/failure_formatters') diff --git a/vendor/bandit/specs/failure_formatters/default_formatter.spec.cpp b/vendor/bandit/specs/failure_formatters/default_formatter.spec.cpp new file mode 100644 index 00000000..6d29b694 --- /dev/null +++ b/vendor/bandit/specs/failure_formatters/default_formatter.spec.cpp @@ -0,0 +1,21 @@ +#include +namespace bd = bandit::detail; + +go_bandit([](){ + + describe("default failure formatter", [&](){ + bd::default_failure_formatter formatter; + + it("formats assertions with file and line number", [&](){ + bd::assertion_exception exception("message", "file", 321); + AssertThat(formatter.format(exception), Equals("file:321: message")); + }); + + it("formats assertions without file and line number", [&](){ + bd::assertion_exception exception("message"); + AssertThat(formatter.format(exception), Equals("message")); + }); + + }); + +}); diff --git a/vendor/bandit/specs/failure_formatters/visual_studio_failure_formatter.spec.cpp b/vendor/bandit/specs/failure_formatters/visual_studio_failure_formatter.spec.cpp new file mode 100644 index 00000000..0d283c8e --- /dev/null +++ b/vendor/bandit/specs/failure_formatters/visual_studio_failure_formatter.spec.cpp @@ -0,0 +1,22 @@ +#include +namespace bd = bandit::detail; + +go_bandit([](){ + + describe("Visual Studio failure formatter:", [&](){ + + bd::visual_studio_failure_formatter formatter; + + it("formats assertions with file and line number", [&](){ + bd::assertion_exception exception("message", "file", 321); + AssertThat(formatter.format(exception), Equals("file(321): message")); + }); + + it("formats assertions without file and line number", [&](){ + bd::assertion_exception exception("message"); + AssertThat(formatter.format(exception), Equals("bandit: message")); + }); + + }); + +}); -- cgit v1.2.3