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
337cb553
Commit
337cb553
authored
Dec 03, 2010
by
Jesse Beder
Browse files
Fixed emitting colon at end of scalar bug
parent
99089bf2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
3 deletions
+26
-3
CMakeLists.txt
CMakeLists.txt
+2
-2
src/regeximpl.h
src/regeximpl.h
+7
-1
test/emittertests.cpp
test/emittertests.cpp
+17
-0
No files found.
CMakeLists.txt
View file @
337cb553
...
@@ -5,8 +5,8 @@ project (YAML_CPP)
...
@@ -5,8 +5,8 @@ project (YAML_CPP)
set
(
LIB_TYPE SHARED
)
set
(
LIB_TYPE SHARED
)
if
(
IPHONE
)
if
(
IPHONE
)
set
(
CMAKE_OSX_SYSROOT iphoneos4.
0
)
set
(
CMAKE_OSX_SYSROOT iphoneos4.
2
)
set
(
CMAKE_OSX_ARCHITECTURES
$
(
ARCHS_STANDARD_32_BIT
)
)
set
(
CMAKE_OSX_ARCHITECTURES
"armv6;armv7"
)
set
(
LIB_TYPE
)
set
(
LIB_TYPE
)
endif
(
IPHONE
)
endif
(
IPHONE
)
...
...
src/regeximpl.h
View file @
337cb553
...
@@ -58,7 +58,13 @@ namespace YAML
...
@@ -58,7 +58,13 @@ namespace YAML
template
<
>
template
<
>
inline
bool
RegEx
::
IsValidSource
<
StringCharSource
>
(
const
StringCharSource
&
source
)
const
inline
bool
RegEx
::
IsValidSource
<
StringCharSource
>
(
const
StringCharSource
&
source
)
const
{
{
return
source
||
m_op
==
REGEX_EMPTY
;
switch
(
m_op
)
{
case
REGEX_MATCH
:
case
REGEX_RANGE
:
return
source
;
default:
return
true
;
}
}
}
template
<
typename
Source
>
template
<
typename
Source
>
...
...
test/emittertests.cpp
View file @
337cb553
...
@@ -726,6 +726,21 @@ namespace Test
...
@@ -726,6 +726,21 @@ namespace Test
out
<<
YAML
::
Binary
(
""
,
0
);
out
<<
YAML
::
Binary
(
""
,
0
);
desiredOutput
=
"--- !!binary
\"\"
"
;
desiredOutput
=
"--- !!binary
\"\"
"
;
}
}
void
ColonAtEndOfScalar
(
YAML
::
Emitter
&
out
,
std
::
string
&
desiredOutput
)
{
out
<<
"a:"
;
desiredOutput
=
"---
\"
a:
\"
"
;
}
void
ColonAsScalar
(
YAML
::
Emitter
&
out
,
std
::
string
&
desiredOutput
)
{
out
<<
YAML
::
BeginMap
;
out
<<
YAML
::
Key
<<
"apple"
<<
YAML
::
Value
<<
":"
;
out
<<
YAML
::
Key
<<
"banana"
<<
YAML
::
Value
<<
":"
;
out
<<
YAML
::
EndMap
;
desiredOutput
=
"---
\n
apple:
\"
:
\"\n
banana:
\"
:
\"
"
;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////
// incorrect emitting
// incorrect emitting
...
@@ -916,6 +931,8 @@ namespace Test
...
@@ -916,6 +931,8 @@ namespace Test
RunEmitterTest
(
&
Emitter
::
Binary
,
"binary"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
Binary
,
"binary"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
LongBinary
,
"long binary"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
LongBinary
,
"long binary"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
EmptyBinary
,
"empty binary"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
EmptyBinary
,
"empty binary"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
ColonAtEndOfScalar
,
"colon at end of scalar"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
ColonAsScalar
,
"colon as scalar"
,
passed
,
total
);
RunEmitterErrorTest
(
&
Emitter
::
ExtraEndSeq
,
"extra EndSeq"
,
passed
,
total
);
RunEmitterErrorTest
(
&
Emitter
::
ExtraEndSeq
,
"extra EndSeq"
,
passed
,
total
);
RunEmitterErrorTest
(
&
Emitter
::
ExtraEndMap
,
"extra EndMap"
,
passed
,
total
);
RunEmitterErrorTest
(
&
Emitter
::
ExtraEndMap
,
"extra EndMap"
,
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