-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolved issue (#445) with empty query parameter values.
- Loading branch information
1 parent
ed83f45
commit 5817f08
Showing
3 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
test/regression/source/uri_get_parameter_fails_to_handle_empty_values.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//System Includes | ||
#include <map> | ||
#include <string> | ||
|
||
//Project Includes | ||
#include <restbed> | ||
|
||
//External Includes | ||
#include <catch.hpp> | ||
|
||
//System Namespaces | ||
using std::string; | ||
using std::multimap; | ||
|
||
//Project Namespaces | ||
using namespace restbed; | ||
|
||
//External Namespaces | ||
|
||
TEST_CASE( "uri get parameter fails to handle empty values", "[uri]" ) | ||
{ | ||
multimap< string, string > expectation {{"param", "1"}}; | ||
Uri uri_with_value( "http://www.corvusoft.co.uk?param=1" ); | ||
REQUIRE( uri_with_value.get_query_parameters( ) == expectation ); | ||
|
||
expectation = {{"param", ""}}; | ||
Uri uri_blank_param( "http://www.corvusoft.co.uk?param=" ); | ||
REQUIRE( uri_blank_param.get_query_parameters( ) == expectation ); | ||
|
||
Uri uri_empty_param( "http://www.corvusoft.co.uk?param" ); | ||
REQUIRE( uri_empty_param.get_query_parameters( ) == expectation ); | ||
} |