Skip to content
Snippets Groups Projects
IstreamTest.cpp 570 B
Newer Older
#include <catch2/catch.hpp>

#include <alib/set>
#include <alib/vector>
#include <alib/pair>
Jan Trávníček's avatar
Jan Trávníček committed
#include <sstream>
#include <alib/istream>
#include <alib/string>
Jan Trávníček's avatar
Jan Trávníček committed

TEST_CASE ( "Istream", "[unit][std][bits]" ) {
	SECTION ( "istream" ) {
		std::stringstream ss ( "TEST" );
Jan Trávníček's avatar
Jan Trávníček committed

		CHECK ( ( ( bool ) ( ss >> ext::string ( "TEST" ) ) ) == true );
Jan Trávníček's avatar
Jan Trávníček committed

		ss.str ( "TEST" );
Jan Trávníček's avatar
Jan Trávníček committed

		CHECK ( ( ( bool ) ( ss >> ext::string ( "TESS" ) ) ) == false );
		CHECK ( ss.str ( ) == "TEST" );
		CHECK ( ( ( bool ) ( ss >> ext::string ( "TESTS" ) ) ) == false );
		CHECK ( ss.str ( ) == "TEST" );
	}
Jan Trávníček's avatar
Jan Trávníček committed
}