Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yaml-cpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
yaml-cpp
Commits
1ab9469f
Commit
1ab9469f
authored
May 23, 2012
by
Jesse Beder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added map/seq gen emitter tests, including some failing ones
parent
3ddfeff4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
test/create-emitter-tests.py
+27
-0
test/genemittertests.h
+0
-0
No files found.
test/create-emitter-tests.py
View file @
1ab9469f
...
...
@@ -68,6 +68,22 @@ def seq_start(tag='', anchor='', anchor_id=0):
def
seq_end
():
return
{
'emit'
:
'YAML::EndSeq'
,
'handle'
:
'SEQ_END()'
}
def
map_start
(
tag
=
''
,
anchor
=
''
,
anchor_id
=
0
):
emit
=
[]
if
tag
:
emit
+=
[
'YAML::VerbatimTag("
%
s")'
%
encode
(
tag
)]
if
anchor
:
emit
+=
[
'YAML::Anchor("
%
s")'
%
encode
(
anchor
)]
if
tag
:
out_tag
=
encode
(
tag
)
else
:
out_tag
=
'?'
emit
+=
[
'YAML::BeginMap'
]
return
{
'emit'
:
emit
,
'handle'
:
'MAP_START("
%
s",
%
s)'
%
(
out_tag
,
anchor_id
)}
def
map_end
():
return
{
'emit'
:
'YAML::EndMap'
,
'handle'
:
'MAP_END()'
}
def
gen_templates
():
yield
[[
doc_start
(),
doc_start
(
True
)],
[
scalar
(
'foo'
),
scalar
(
'foo
\n
'
),
scalar
(
'foo'
,
'tag'
),
scalar
(
'foo'
,
''
,
'anchor'
,
1
)],
...
...
@@ -77,6 +93,17 @@ def gen_templates():
[[],
[
scalar
(
'foo'
)],
[
scalar
(
'foo'
,
'tag'
)],
[
scalar
(
'foo'
,
''
,
'anchor'
,
1
)],
[
scalar
(
'foo'
,
'tag'
,
'anchor'
,
1
)],
[
scalar
(
'foo'
),
scalar
(
'bar'
)],
[
scalar
(
'foo'
,
'tag'
,
'anchor'
,
1
),
scalar
(
'bar'
,
'tag'
,
'other'
,
2
)]],
[
seq_end
()],
[
doc_end
(),
doc_end
(
True
)]]
yield
[[
doc_start
(),
doc_start
(
True
)],
[
map_start
()],
[[],
[
scalar
(
'foo'
),
scalar
(
'bar'
)],
[
scalar
(
'foo'
,
'tag'
,
'anchor'
,
1
),
scalar
(
'bar'
,
'tag'
,
'other'
,
2
)]],
[
map_end
()],
[
doc_end
(),
doc_end
(
True
)]]
yield
[[
doc_start
(
True
)],
[
map_start
()],
[[
scalar
(
'foo'
)],
[
seq_start
(),
scalar
(
'foo'
),
seq_end
()],
[
map_start
(),
scalar
(
'foo'
),
scalar
(
'bar'
),
map_end
()]],
[[
scalar
(
'foo'
)],
[
seq_start
(),
scalar
(
'foo'
),
seq_end
()],
[
map_start
(),
scalar
(
'foo'
),
scalar
(
'bar'
),
map_end
()]],
[
map_end
()],
[
doc_end
(
True
)]]
def
expand
(
template
):
if
len
(
template
)
==
0
:
...
...
test/genemittertests.h
View file @
1ab9469f
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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