Wrote some tests, but they don't work because it doesn't output maps in a canonical form.

This commit is contained in:
beder
2008-07-05 19:00:58 +00:00
parent ba97c9f719
commit 3cad5a2ed0
8 changed files with 167 additions and 14 deletions

View File

@@ -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;
}
}