UTIL: attempt to fix the newline problem with gitattributes
parent
b75c029c0b
commit
4017049e87
|
@ -0,0 +1 @@
|
|||
*.h text eol=lf
|
|
@ -6,12 +6,6 @@
|
|||
#include "util/IncludeUtil.h"
|
||||
#include <SDL_platform.h>
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
#define NEWLINE "\r\n"
|
||||
#else
|
||||
#define NEWLINE "\n"
|
||||
#endif
|
||||
|
||||
class IncludeUtilTest : public core::AbstractTest {
|
||||
};
|
||||
|
||||
|
@ -23,9 +17,9 @@ TEST_F(IncludeUtilTest, testInclude) {
|
|||
std::pair<std::string, bool> retIncludes = util::handleIncludes(src, includeDirs, &includedFiles);
|
||||
EXPECT_TRUE(retIncludes.second);
|
||||
EXPECT_EQ(2u, includedFiles.size());
|
||||
EXPECT_EQ("#error \"one\"" NEWLINE "#include \"two.h\"" NEWLINE NEWLINE "#error \"two\"" NEWLINE NEWLINE, retIncludes.first);
|
||||
EXPECT_EQ("#error \"one\"\n#include \"two.h\"\n\n#error \"two\"\n\n", retIncludes.first);
|
||||
retIncludes = util::handleIncludes(retIncludes.first, includeDirs, &includedFiles);
|
||||
EXPECT_TRUE(retIncludes.second);
|
||||
EXPECT_EQ(3u, includedFiles.size());
|
||||
EXPECT_EQ("#error \"one\"" NEWLINE "#error \"two\"" NEWLINE NEWLINE NEWLINE "#error \"two\"" NEWLINE NEWLINE, retIncludes.first);
|
||||
EXPECT_EQ("#error \"one\"\n#error \"two\"\n\n\n#error \"two\"\n\n", retIncludes.first);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue