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
fdfffb09
"include/vscode:/vscode.git/clone" did not exist on "d84b00c7debde0a4ca11ff053304fd1989853375"
Commit
fdfffb09
authored
May 23, 2012
by
Jesse Beder
Browse files
Added gen emitter tests
parent
52d01ff1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
209 additions
and
1 deletion
+209
-1
test/create-emitter-tests.py
test/create-emitter-tests.py
+1
-1
test/genemittertests.h
test/genemittertests.h
+208
-0
No files found.
test/create-emitter-tests.py
View file @
fdfffb09
...
...
@@ -53,7 +53,7 @@ def comment(value):
return
{
'emit'
:
'YAML::Comment("%s")'
%
value
,
'handle'
:
''
}
def
gen_templates
():
yield
[[
doc_start
(),
doc_start
(
True
)],
[
scalar
(
'foo'
)],
[
doc_end
(),
doc_end
(
True
)]]
yield
[[
doc_start
(),
doc_start
(
True
)],
[
scalar
(
'foo'
)
,
scalar
(
'foo
\n
'
)
],
[
doc_end
(),
doc_end
(
True
)]]
def
expand
(
template
):
if
len
(
template
)
==
0
:
...
...
test/genemittertests.h
View file @
fdfffb09
...
...
@@ -99,6 +99,106 @@ TEST teste181778974c4003bc5a4(YAML::Emitter& out)
EXPECT_DOC_END
();
DONE
();
}
TEST
testf8cb7e3f1b11791f53b8
(
YAML
::
Emitter
&
out
)
{
out
<<
YAML
::
Comment
(
"comment"
);
out
<<
YAML
::
BeginDoc
;
out
<<
"foo
\n
"
;
out
<<
YAML
::
EndDoc
;
HANDLE
(
out
.
c_str
());
EXPECT_DOC_START
();
EXPECT_SCALAR
(
"!"
,
0
,
"foo
\n
"
);
EXPECT_DOC_END
();
DONE
();
}
TEST
test3c48ed06807100f0a111
(
YAML
::
Emitter
&
out
)
{
out
<<
YAML
::
BeginDoc
;
out
<<
YAML
::
Comment
(
"comment"
);
out
<<
"foo
\n
"
;
out
<<
YAML
::
EndDoc
;
HANDLE
(
out
.
c_str
());
EXPECT_DOC_START
();
EXPECT_SCALAR
(
"!"
,
0
,
"foo
\n
"
);
EXPECT_DOC_END
();
DONE
();
}
TEST
testb13f7b031f425b0e383f
(
YAML
::
Emitter
&
out
)
{
out
<<
YAML
::
BeginDoc
;
out
<<
"foo
\n
"
;
out
<<
YAML
::
Comment
(
"comment"
);
out
<<
YAML
::
EndDoc
;
HANDLE
(
out
.
c_str
());
EXPECT_DOC_START
();
EXPECT_SCALAR
(
"!"
,
0
,
"foo
\n
"
);
EXPECT_DOC_END
();
DONE
();
}
TEST
testb77284234d3fbe8b24a0
(
YAML
::
Emitter
&
out
)
{
out
<<
YAML
::
BeginDoc
;
out
<<
"foo
\n
"
;
out
<<
YAML
::
EndDoc
;
out
<<
YAML
::
Comment
(
"comment"
);
HANDLE
(
out
.
c_str
());
EXPECT_DOC_START
();
EXPECT_SCALAR
(
"!"
,
0
,
"foo
\n
"
);
EXPECT_DOC_END
();
DONE
();
}
TEST
test9c56fd285b563327a340
(
YAML
::
Emitter
&
out
)
{
out
<<
YAML
::
Comment
(
"comment"
);
out
<<
YAML
::
BeginDoc
;
out
<<
"foo
\n
"
;
HANDLE
(
out
.
c_str
());
EXPECT_DOC_START
();
EXPECT_SCALAR
(
"!"
,
0
,
"foo
\n
"
);
EXPECT_DOC_END
();
DONE
();
}
TEST
test1c08639d56176e64c885
(
YAML
::
Emitter
&
out
)
{
out
<<
YAML
::
BeginDoc
;
out
<<
YAML
::
Comment
(
"comment"
);
out
<<
"foo
\n
"
;
HANDLE
(
out
.
c_str
());
EXPECT_DOC_START
();
EXPECT_SCALAR
(
"!"
,
0
,
"foo
\n
"
);
EXPECT_DOC_END
();
DONE
();
}
TEST
test94c8742f8cab3cec1b4a
(
YAML
::
Emitter
&
out
)
{
out
<<
YAML
::
BeginDoc
;
out
<<
"foo
\n
"
;
out
<<
YAML
::
Comment
(
"comment"
);
HANDLE
(
out
.
c_str
());
EXPECT_DOC_START
();
EXPECT_SCALAR
(
"!"
,
0
,
"foo
\n
"
);
EXPECT_DOC_END
();
DONE
();
}
TEST
test79d1806ceb3ecebfa60b
(
YAML
::
Emitter
&
out
)
{
out
<<
YAML
::
BeginDoc
;
out
<<
"foo
\n
"
;
out
<<
YAML
::
Comment
(
"comment"
);
HANDLE
(
out
.
c_str
());
EXPECT_DOC_START
();
EXPECT_SCALAR
(
"!"
,
0
,
"foo
\n
"
);
EXPECT_DOC_END
();
DONE
();
}
TEST
test0c7bb03fbd6b52ea3ad6
(
YAML
::
Emitter
&
out
)
{
out
<<
YAML
::
Comment
(
"comment"
);
...
...
@@ -191,6 +291,98 @@ TEST test03229f6d33fa9007a65d(YAML::Emitter& out)
EXPECT_DOC_END
();
DONE
();
}
TEST
testf998264dcfd0dba06c0a
(
YAML
::
Emitter
&
out
)
{
out
<<
YAML
::
Comment
(
"comment"
);
out
<<
"foo
\n
"
;
out
<<
YAML
::
EndDoc
;
HANDLE
(
out
.
c_str
());
EXPECT_DOC_START
();
EXPECT_SCALAR
(
"!"
,
0
,
"foo
\n
"
);
EXPECT_DOC_END
();
DONE
();
}
TEST
test7defadc52eddfbf766aa
(
YAML
::
Emitter
&
out
)
{
out
<<
YAML
::
Comment
(
"comment"
);
out
<<
"foo
\n
"
;
out
<<
YAML
::
EndDoc
;
HANDLE
(
out
.
c_str
());
EXPECT_DOC_START
();
EXPECT_SCALAR
(
"!"
,
0
,
"foo
\n
"
);
EXPECT_DOC_END
();
DONE
();
}
TEST
test55a7c58211689c7815b2
(
YAML
::
Emitter
&
out
)
{
out
<<
"foo
\n
"
;
out
<<
YAML
::
Comment
(
"comment"
);
out
<<
YAML
::
EndDoc
;
HANDLE
(
out
.
c_str
());
EXPECT_DOC_START
();
EXPECT_SCALAR
(
"!"
,
0
,
"foo
\n
"
);
EXPECT_DOC_END
();
DONE
();
}
TEST
testc3873d954433175e0143
(
YAML
::
Emitter
&
out
)
{
out
<<
"foo
\n
"
;
out
<<
YAML
::
EndDoc
;
out
<<
YAML
::
Comment
(
"comment"
);
HANDLE
(
out
.
c_str
());
EXPECT_DOC_START
();
EXPECT_SCALAR
(
"!"
,
0
,
"foo
\n
"
);
EXPECT_DOC_END
();
DONE
();
}
TEST
test81fb6bf1f976e0ad3fba
(
YAML
::
Emitter
&
out
)
{
out
<<
YAML
::
Comment
(
"comment"
);
out
<<
"foo
\n
"
;
HANDLE
(
out
.
c_str
());
EXPECT_DOC_START
();
EXPECT_SCALAR
(
"!"
,
0
,
"foo
\n
"
);
EXPECT_DOC_END
();
DONE
();
}
TEST
test29e7ff04645f56a7ea2f
(
YAML
::
Emitter
&
out
)
{
out
<<
YAML
::
Comment
(
"comment"
);
out
<<
"foo
\n
"
;
HANDLE
(
out
.
c_str
());
EXPECT_DOC_START
();
EXPECT_SCALAR
(
"!"
,
0
,
"foo
\n
"
);
EXPECT_DOC_END
();
DONE
();
}
TEST
testce0089a55f926d311ff4
(
YAML
::
Emitter
&
out
)
{
out
<<
"foo
\n
"
;
out
<<
YAML
::
Comment
(
"comment"
);
HANDLE
(
out
.
c_str
());
EXPECT_DOC_START
();
EXPECT_SCALAR
(
"!"
,
0
,
"foo
\n
"
);
EXPECT_DOC_END
();
DONE
();
}
TEST
testd1d301bbc73ec11cd49b
(
YAML
::
Emitter
&
out
)
{
out
<<
"foo
\n
"
;
out
<<
YAML
::
Comment
(
"comment"
);
HANDLE
(
out
.
c_str
());
EXPECT_DOC_START
();
EXPECT_SCALAR
(
"!"
,
0
,
"foo
\n
"
);
EXPECT_DOC_END
();
DONE
();
}
}
void
RunGenEmitterTests
(
int
&
passed
,
int
&
total
)
{
...
...
@@ -202,6 +394,14 @@ void RunGenEmitterTests(int& passed, int& total)
RunGenEmitterTest
(
&
Emitter
::
test869ab95640c9933ed4d6
,
"test869ab95640c9933ed4d6"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test433c0771f40ac3ba853e
,
"test433c0771f40ac3ba853e"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
teste181778974c4003bc5a4
,
"teste181778974c4003bc5a4"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
testf8cb7e3f1b11791f53b8
,
"testf8cb7e3f1b11791f53b8"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test3c48ed06807100f0a111
,
"test3c48ed06807100f0a111"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
testb13f7b031f425b0e383f
,
"testb13f7b031f425b0e383f"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
testb77284234d3fbe8b24a0
,
"testb77284234d3fbe8b24a0"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test9c56fd285b563327a340
,
"test9c56fd285b563327a340"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test1c08639d56176e64c885
,
"test1c08639d56176e64c885"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test94c8742f8cab3cec1b4a
,
"test94c8742f8cab3cec1b4a"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test79d1806ceb3ecebfa60b
,
"test79d1806ceb3ecebfa60b"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test0c7bb03fbd6b52ea3ad6
,
"test0c7bb03fbd6b52ea3ad6"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
testb819efb5742c1176df98
,
"testb819efb5742c1176df98"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test1f7b7cd5a13070c723d3
,
"test1f7b7cd5a13070c723d3"
,
passed
,
total
);
...
...
@@ -210,4 +410,12 @@ void RunGenEmitterTests(int& passed, int& total)
RunGenEmitterTest
(
&
Emitter
::
test5030b4f2d1efb798f320
,
"test5030b4f2d1efb798f320"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
testb9015537b9a9e09b8ec8
,
"testb9015537b9a9e09b8ec8"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test03229f6d33fa9007a65d
,
"test03229f6d33fa9007a65d"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
testf998264dcfd0dba06c0a
,
"testf998264dcfd0dba06c0a"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test7defadc52eddfbf766aa
,
"test7defadc52eddfbf766aa"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test55a7c58211689c7815b2
,
"test55a7c58211689c7815b2"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
testc3873d954433175e0143
,
"testc3873d954433175e0143"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test81fb6bf1f976e0ad3fba
,
"test81fb6bf1f976e0ad3fba"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test29e7ff04645f56a7ea2f
,
"test29e7ff04645f56a7ea2f"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
testce0089a55f926d311ff4
,
"testce0089a55f926d311ff4"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
testd1d301bbc73ec11cd49b
,
"testd1d301bbc73ec11cd49b"
,
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