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
d904b600
Commit
d904b600
authored
Aug 04, 2011
by
Jesse Beder
Browse files
Added test for anchor/alias in flow
parent
bacb74e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
test/emittertests.cpp
test/emittertests.cpp
+15
-0
No files found.
test/emittertests.cpp
View file @
d904b600
...
@@ -282,6 +282,20 @@ namespace Test
...
@@ -282,6 +282,20 @@ namespace Test
desiredOutput
=
"- &fred ~
\n
- *fred"
;
desiredOutput
=
"- &fred ~
\n
- *fred"
;
}
}
void
AliasAndAnchorInFlow
(
YAML
::
Emitter
&
out
,
std
::
string
&
desiredOutput
)
{
out
<<
YAML
::
Flow
<<
YAML
::
BeginSeq
;
out
<<
YAML
::
Anchor
(
"fred"
);
out
<<
YAML
::
BeginMap
;
out
<<
YAML
::
Key
<<
"name"
<<
YAML
::
Value
<<
"Fred"
;
out
<<
YAML
::
Key
<<
"age"
<<
YAML
::
Value
<<
42
;
out
<<
YAML
::
EndMap
;
out
<<
YAML
::
Alias
(
"fred"
);
out
<<
YAML
::
EndSeq
;
desiredOutput
=
"[&fred {name: Fred, age: 42}, *fred]"
;
}
void
SimpleVerbatimTag
(
YAML
::
Emitter
&
out
,
std
::
string
&
desiredOutput
)
void
SimpleVerbatimTag
(
YAML
::
Emitter
&
out
,
std
::
string
&
desiredOutput
)
{
{
out
<<
YAML
::
VerbatimTag
(
"!foo"
)
<<
"bar"
;
out
<<
YAML
::
VerbatimTag
(
"!foo"
)
<<
"bar"
;
...
@@ -997,6 +1011,7 @@ namespace Test
...
@@ -997,6 +1011,7 @@ namespace Test
RunEmitterTest
(
&
Emitter
::
BlockMapAsKey
,
"block map as key"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
BlockMapAsKey
,
"block map as key"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
AliasAndAnchor
,
"alias and anchor"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
AliasAndAnchor
,
"alias and anchor"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
AliasAndAnchorWithNull
,
"alias and anchor with null"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
AliasAndAnchorWithNull
,
"alias and anchor with null"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
AliasAndAnchorInFlow
,
"alias and anchor in flow"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
SimpleVerbatimTag
,
"simple verbatim tag"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
SimpleVerbatimTag
,
"simple verbatim tag"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
VerbatimTagInBlockSeq
,
"verbatim tag in block seq"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
VerbatimTagInBlockSeq
,
"verbatim tag in block seq"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
VerbatimTagInFlowSeq
,
"verbatim tag in flow seq"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
VerbatimTagInFlowSeq
,
"verbatim tag in flow seq"
,
passed
,
total
);
...
...
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