diff --git a/include/valijson/adapters/yaml_cpp_adapter.hpp b/include/valijson/adapters/yaml_cpp_adapter.hpp index cf96265..ffcd0d1 100644 --- a/include/valijson/adapters/yaml_cpp_adapter.hpp +++ b/include/valijson/adapters/yaml_cpp_adapter.hpp @@ -402,17 +402,17 @@ class YamlCppValue bool isBool() const { - return m_value.IsScalar(); + return false; } bool isDouble() const { - return m_value.IsScalar(); + return false; } bool isInteger() const { - return m_value.IsScalar(); + return false; } bool isNull() const @@ -422,7 +422,7 @@ class YamlCppValue bool isNumber() const { - return m_value.IsScalar(); + return false; } bool isObject() const @@ -432,7 +432,7 @@ class YamlCppValue bool isString() const { - return m_value.IsScalar(); + return true; } private: diff --git a/tests/test_yaml_cpp_adapter.cpp b/tests/test_yaml_cpp_adapter.cpp index f3ac43a..21de2e7 100644 --- a/tests/test_yaml_cpp_adapter.cpp +++ b/tests/test_yaml_cpp_adapter.cpp @@ -34,7 +34,9 @@ TEST_F(TestYamlCppAdapter, BasicArrayIteration) // Ensure that the elements are returned in the order they were inserted unsigned int expectedValue = 0; for (const valijson::adapters::YamlCppAdapter value : adapter.getArray()) { - ASSERT_TRUE(value.isNumber()); + ASSERT_TRUE(value.isString()); + ASSERT_FALSE(value.isNumber()); + ASSERT_TRUE(value.maybeDouble()); EXPECT_EQ(double(expectedValue), value.getDouble()); expectedValue++; }