mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 20:51:16 +00:00
Wrote some tests, but they don't work because it doesn't output maps in a canonical form.
This commit is contained in:
27
main.cpp
27
main.cpp
@@ -1,4 +1,5 @@
|
||||
#include "parser.h"
|
||||
#include "tests.h"
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
@@ -64,21 +65,23 @@ void operator >> (const YAML::Node& node, Level& level)
|
||||
|
||||
int main()
|
||||
{
|
||||
std::ifstream fin("test.yaml");
|
||||
YAML::Test::RunAll();
|
||||
|
||||
try {
|
||||
YAML::Parser parser(fin);
|
||||
if(!parser)
|
||||
return 0;
|
||||
//std::ifstream fin("test.yaml");
|
||||
|
||||
YAML::Node doc;
|
||||
parser.GetNextDocument(doc);
|
||||
std::cout << doc;
|
||||
} catch(YAML::Exception&) {
|
||||
std::cout << "Error parsing the yaml!\n";
|
||||
}
|
||||
//try {
|
||||
// YAML::Parser parser(fin);
|
||||
// if(!parser)
|
||||
// return 0;
|
||||
|
||||
// YAML::Node doc;
|
||||
// parser.GetNextDocument(doc);
|
||||
// std::cout << doc;
|
||||
//} catch(YAML::Exception&) {
|
||||
// std::cout << "Error parsing the yaml!\n";
|
||||
//}
|
||||
|
||||
getchar();
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user