#include "../LineComments.h" #include #include #include #include static auto stream( const std::string &text ) { std::istringstream iss{ text }; iss >> Alepha::IOStreams::DropComments{}; std::string s; getline( iss, s, {} ); return s; } static auto init= Alepha::Utility::enroll <=[] { using namespace Alepha::Testing::exports; "Do we strip comments correctly"_test <=TableTest< stream > ::Cases { { "Simple (no comment)", { "Hello World!" }, "Hello World!" }, { "Simple (One comment)", { "Hello World!# Comment" }, "Hello World!" }, { "Two lines (One comment at end)", { "Hello World!\nGoodbye World! # Comment" }, "Hello World!\nGoodbye World! " }, { "Two lines (One comment after first)", { "Hello World! #Comment\nGoodbye World!" }, "Hello World! \nGoodbye World!" }, { "Two lines (Two comments)", { "Hello World! #Comment\nGoodbye World! #Comment" }, "Hello World! \nGoodbye World! " }, { "Two lines (Two comments, extra newline)", { "Hello World! #Comment\nGoodbye World! #Comment\n" }, "Hello World! \nGoodbye World! \n" }, }; };