diff --git a/test_drivers/regression_tests/reg_tests_driver.cpp b/test_drivers/regression_tests/reg_tests_driver.cpp index 81d97eb..0a3013b 100644 --- a/test_drivers/regression_tests/reg_tests_driver.cpp +++ b/test_drivers/regression_tests/reg_tests_driver.cpp @@ -22,6 +22,9 @@ inline void check_impl (bool condition, const char* file, int line) // Release 2.2.2 #include "r2_2_2/basic_functionality.h" +// Release 2.3.1 +#include "r2_3_1/basic_functionality.h" + int main() { // Release 1.0 Beta 1 @@ -44,4 +47,8 @@ int main() //r2_2_2/basic_functionality.h id_2852872(); id_2857454(); + +// Release 2.3.1 +// r2_3_1/basic_functionality.h + id_3414834(); } diff --git a/v2_0/test_drivers/regression_tests/r2_3_1/basic_functionality.h b/v2_0/test_drivers/regression_tests/r2_3_1/basic_functionality.h new file mode 100644 index 0000000..e628328 --- /dev/null +++ b/v2_0/test_drivers/regression_tests/r2_3_1/basic_functionality.h @@ -0,0 +1,38 @@ +#include "../../../source/utf8.h" + +#include +#include + +// [ 3414834 ] Testing unchecked::iterator< istreambuf_iterator< char > > +void id_3414834() +{ + typedef std::istreambuf_iterator< char > char_iterator; + typedef utf8::unchecked::iterator< char_iterator > utf8_iterator; + + std::string input = "The rain in Spain falls mainly on the plain."; + //std::cout << input << std::endl; + + std::string output; + { + std::vector< uint32_t > output_characters; + { + std::stringstream input_stream( input ); + utf8_iterator const input_terminator; + for( + utf8_iterator input_iterator( input_stream ); + input_iterator != input_terminator; + ++input_iterator + ) { + output_characters.push_back( *input_iterator ); + } + } + + utf8::utf32to8( output_characters.begin(), output_characters.end(), + std::back_inserter( output ) + ); + } + //std::cout << output << std::endl; + + check(output == input); +} +