mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-10 04:51:17 +00:00
Unified line endings.
This commit is contained in:
@@ -14,7 +14,7 @@ void run()
|
||||
std::ifstream fin("tests/test.yaml");
|
||||
|
||||
try {
|
||||
YAML::Parser parser(fin);
|
||||
YAML::Parser parser(fin);
|
||||
parser.PrintTokens(std::cout);
|
||||
} catch(YAML::Exception&) {
|
||||
std::cout << "Error parsing the yaml!\n";
|
||||
@@ -22,15 +22,15 @@ void run()
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
bool verbose = false;
|
||||
for(int i=1;i<argc;i++) {
|
||||
if(strcmp(argv[i], "-v") == 0)
|
||||
verbose = true;
|
||||
}
|
||||
|
||||
{
|
||||
bool verbose = false;
|
||||
for(int i=1;i<argc;i++) {
|
||||
if(strcmp(argv[i], "-v") == 0)
|
||||
verbose = true;
|
||||
}
|
||||
|
||||
#ifdef WINDOWS
|
||||
_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF|_CRTDBG_ALLOC_MEM_DF);
|
||||
_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF|_CRTDBG_ALLOC_MEM_DF);
|
||||
#endif // WINDOWS
|
||||
Test::RunAll(verbose);
|
||||
run();
|
||||
|
@@ -22,7 +22,7 @@ namespace Test
|
||||
if(!Inout(files[i], verbose)) {
|
||||
std::cout << "Inout test failed on " << files[i] << "\n";
|
||||
passed = false;
|
||||
} else
|
||||
} else
|
||||
std::cout << "Inout test passed: " << files[i] << "\n";
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Test
|
||||
// outputs again, and makes sure that the two outputs are the same
|
||||
bool Inout(const std::string& file, bool verbose)
|
||||
{
|
||||
std::ifstream fin(file.c_str());
|
||||
std::ifstream fin(file.c_str());
|
||||
|
||||
try {
|
||||
// read and output
|
||||
@@ -71,14 +71,14 @@ namespace Test
|
||||
fout << "---\n";
|
||||
fout << secondTry << std::endl;
|
||||
} catch(YAML::ParserException& e) {
|
||||
std::cout << file << " (line " << e.line + 1 << ", col " << e.column + 1 << "): " << e.msg << std::endl;
|
||||
|
||||
if(verbose) {
|
||||
std::cout << "Token queue:\n";
|
||||
std::ifstream f(file.c_str());
|
||||
YAML::Parser p(f);
|
||||
p.PrintTokens(std::cout);
|
||||
}
|
||||
std::cout << file << " (line " << e.line + 1 << ", col " << e.column + 1 << "): " << e.msg << std::endl;
|
||||
|
||||
if(verbose) {
|
||||
std::cout << "Token queue:\n";
|
||||
std::ifstream f(file.c_str());
|
||||
YAML::Parser p(f);
|
||||
p.PrintTokens(std::cout);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@@ -1,3 +1,3 @@
|
||||
- it's just
|
||||
- one thing
|
||||
- after another
|
||||
- after another
|
||||
|
Reference in New Issue
Block a user