Added bool conversions

This commit is contained in:
beder
2011-09-14 01:48:36 -05:00
parent 4e6418ff12
commit 36086448d2
3 changed files with 103 additions and 5 deletions

View File

@@ -259,6 +259,15 @@ namespace Test
YAML_ASSERT(node["other"] == node["key"]);
return true;
}
TEST Bool()
{
YAML::Node node;
node[true] = false;
YAML_ASSERT(node.IsMap());
YAML_ASSERT(node[true].as<bool>() == false);
return true;
}
}
void RunNodeTest(TEST (*test)(), const std::string& name, int& passed, int& total) {
@@ -302,6 +311,7 @@ namespace Test
RunNodeTest(&Node::SelfReferenceMap, "self reference map", passed, total);
RunNodeTest(&Node::TempMapVariable, "temp map variable", passed, total);
RunNodeTest(&Node::TempMapVariableAlias, "temp map variable alias", passed, total);
RunNodeTest(&Node::Bool, "bool", passed, total);
std::cout << "Node tests: " << passed << "/" << total << " passed\n";
return passed == total;