mirror of
https://github.com/status-im/NimYAML.git
synced 2025-01-27 11:34:56 +00:00
Improved test code
This commit is contained in:
parent
356dc5c8bd
commit
737d326e7a
@ -4,7 +4,7 @@
|
|||||||
# See the file "copying.txt", included in this
|
# See the file "copying.txt", included in this
|
||||||
# distribution, for details about the copyright.
|
# distribution, for details about the copyright.
|
||||||
|
|
||||||
import "../yaml"
|
import "../yaml", strutils
|
||||||
|
|
||||||
proc escapeNewlines(s: string): string =
|
proc escapeNewlines(s: string): string =
|
||||||
result = ""
|
result = ""
|
||||||
@ -22,7 +22,7 @@ proc printDifference*(expected, actual: YamlStreamEvent) =
|
|||||||
case expected.kind
|
case expected.kind
|
||||||
of yamlScalar:
|
of yamlScalar:
|
||||||
if expected.scalarTag != actual.scalarTag:
|
if expected.scalarTag != actual.scalarTag:
|
||||||
echo "[\"", actual.scalarContent, "\".tag] expected tag ",
|
echo "[", escape(actual.scalarContent), ".tag] expected tag ",
|
||||||
expected.scalarTag, ", got ", actual.scalarTag
|
expected.scalarTag, ", got ", actual.scalarTag
|
||||||
elif expected.scalarAnchor != actual.scalarAnchor:
|
elif expected.scalarAnchor != actual.scalarAnchor:
|
||||||
echo "[scalarEvent] expected anchor ", expected.scalarAnchor,
|
echo "[scalarEvent] expected anchor ", expected.scalarAnchor,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user