Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
yaml-cpp
Commits
39e7b651
Commit
39e7b651
authored
Feb 21, 2015
by
Jesse Beder
Browse files
Fix test that depended on the order of map outputs
parent
0970a108
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
test/node/node_test.cpp
test/node/node_test.cpp
+15
-2
No files found.
test/node/node_test.cpp
View file @
39e7b651
...
@@ -6,8 +6,12 @@
...
@@ -6,8 +6,12 @@
#include "yaml-cpp/node/iterator.h"
#include "yaml-cpp/node/iterator.h"
#include "yaml-cpp/node/detail/impl.h"
#include "yaml-cpp/node/detail/impl.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
using
::
testing
::
AnyOf
;
using
::
testing
::
Eq
;
namespace
YAML
{
namespace
YAML
{
namespace
{
namespace
{
TEST
(
NodeTest
,
SimpleScalar
)
{
TEST
(
NodeTest
,
SimpleScalar
)
{
...
@@ -285,6 +289,14 @@ class NodeEmitterTest : public ::testing::Test {
...
@@ -285,6 +289,14 @@ class NodeEmitterTest : public ::testing::Test {
ASSERT_TRUE
(
emitter
.
good
());
ASSERT_TRUE
(
emitter
.
good
());
EXPECT_EQ
(
output
,
emitter
.
c_str
());
EXPECT_EQ
(
output
,
emitter
.
c_str
());
}
}
void
ExpectAnyOutput
(
const
Node
&
node
,
const
std
::
string
&
output1
,
const
std
::
string
&
output2
)
{
Emitter
emitter
;
emitter
<<
node
;
ASSERT_TRUE
(
emitter
.
good
());
EXPECT_THAT
(
emitter
.
c_str
(),
AnyOf
(
Eq
(
output1
),
Eq
(
output2
)));
}
};
};
TEST_F
(
NodeEmitterTest
,
SimpleFlowSeqNode
)
{
TEST_F
(
NodeEmitterTest
,
SimpleFlowSeqNode
)
{
...
@@ -363,8 +375,9 @@ TEST_F(NodeEmitterTest, NestBlockMixMapListNode) {
...
@@ -363,8 +375,9 @@ TEST_F(NodeEmitterTest, NestBlockMixMapListNode) {
blockNode
[
"scalar"
]
=
1.01
;
blockNode
[
"scalar"
]
=
1.01
;
blockNode
[
"object"
]
=
mapNode
;
blockNode
[
"object"
]
=
mapNode
;
ExpectOutput
(
"scalar: 1.01
\n
object: {position: [1.01, 2.01, 3.01]}"
,
ExpectAnyOutput
(
blockNode
,
blockNode
);
"scalar: 1.01
\n
object: {position: [1.01, 2.01, 3.01]}"
,
"object: {position: [1.01, 2.01, 3.01]}
\n
scalar: 1.01"
);
}
}
TEST_F
(
NodeEmitterTest
,
NestBlockMapListNode
)
{
TEST_F
(
NodeEmitterTest
,
NestBlockMapListNode
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment