Skip to content

Commit a687b35

Browse files
committed
适应git action的 linux,macox的毛病
1 parent 288c5bb commit a687b35

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Test/src/CodeFormatTest.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ bool TestFormatted(std::string input, const std::string& shouldBe, std::shared_p
1919
formatter.BuildFormattedElement();
2020

2121
auto formattedText = formatter.GetFormattedText();
22-
auto f1 = StringUtil::TrimSpace(formattedText);
23-
auto f2 = StringUtil::TrimSpace(shouldBe);
24-
25-
std::cout << format("size {} {}", f1.size(), f2.size()) << std::endl;
2622

2723
return StringUtil::TrimSpace(formattedText) == StringUtil::TrimSpace(shouldBe);
2824
}
@@ -69,7 +65,8 @@ void CollectLuaFile(std::filesystem::path directoryPath, std::vector<std::string
6965

7066
std::string ReadFile(const std::string& path)
7167
{
72-
std::fstream fin(path, std::ios::in | std::ios::binary);
68+
// std::ios::binary 取消读取
69+
std::fstream fin(path, std::ios::in);
7370

7471
if (fin.is_open())
7572
{
@@ -110,6 +107,9 @@ int main(int argc, char* argv[])
110107
if (target == "CheckFormatResult")
111108
{
112109
auto options = std::make_shared<LuaCodeStyleOptions>();
110+
#ifndef _WIN32
111+
options->end_of_line = "\n";
112+
#endif
113113
std::filesystem::path formattedRoot(commandLine.Get<std::string>("formatted-work-directory"));
114114
for (auto& path : luaFiles)
115115
{

0 commit comments

Comments
 (0)