mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
New unit_test framework:
* Header-only! * No external dependencies or other beast modules * Compilation options allow for: - Stand-alone application to run a single test suite - Stand-alone application to run a set of test suites - Global suite of tests inline with the host application - Disable test suite generation completely * Existing tests reworked to use the new classes
This commit is contained in:
@@ -18,11 +18,12 @@
|
||||
//==============================================================================
|
||||
|
||||
#include "../ParsedURL.h"
|
||||
|
||||
#include "../../../modules/beast_core/beast_core.h" // for UnitTest
|
||||
#include "../../strings/String.h"
|
||||
|
||||
#include "joyent_parser.h"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace beast {
|
||||
|
||||
ParsedURL::ParsedURL ()
|
||||
@@ -146,35 +147,4 @@ URL ParsedURL::url () const
|
||||
return m_url;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class ParsedURLTests : public UnitTest
|
||||
{
|
||||
public:
|
||||
void checkURL (String const& url)
|
||||
{
|
||||
ParsedURL result (url);
|
||||
expect (result.error () == 0);
|
||||
expect (result.url ().toString () == url);
|
||||
}
|
||||
|
||||
void testURL ()
|
||||
{
|
||||
beginTestCase ("parse URL");
|
||||
|
||||
checkURL ("http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference.html");
|
||||
}
|
||||
|
||||
void runTest ()
|
||||
{
|
||||
testURL ();
|
||||
}
|
||||
|
||||
ParsedURLTests () : UnitTest ("ParsedURL", "beast", runManual)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
static ParsedURLTests parsedURLTests;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user