# YAML Test Matrix

--- &test-3UYS
  Title: Escaped slash in double quotes
  Tags: [ double ]

YAML

escaped slash: "a\/b"

Expected Events

+STR
+DOC
+MAP
=VAL :escaped slash
=VAL "a/b
-MAP
-DOC
-STR

Expected JSON

{
"escaped slash": "a/b"
}

cpp-event

 ok

hs-yaml-event

 ok

js-event

 ok

libyaml-event

 ok

nimyaml-event

 ok

perl5-pp-event

 ok

pyyaml-event

 ok

ruamel-event

 ok

hs-yaml-json

 json_ok

js-json

 json_ok

js-yaml-json

 json_ok

perl5-pp-json

 json_ok

perl5-xs-json

 json_ok

pyyaml-json

 json_ok

ruamel-json

 json_ok

perl5-pegex-event

 diff
Got Events:
+STR
+DOC
+MAP
=VAL :escaped slash
=VAL "a\/b
-MAP
-DOC
-STR

perl5-pm-json

 json_diff
{
  "escaped slash": "a\\/b"
}

perl5-syck-json

 json_diff
{
  "escaped slash": "a\\/b"
}

perl5-tiny-json

 json_diff
{
  "escaped slash": "a\\/b"
}

java-event

 error
Exception in thread "main" while scanning a double-quoted scalar
 in 'reader', line 1, column 16:
    escaped slash: "a\/b"
                   ^
found unknown escape character /(47)
 in 'reader', line 1, column 19:
    escaped slash: "a\/b"
                      ^

	at org.yaml.snakeyaml.scanner.ScannerImpl.scanFlowScalarNonSpaces(ScannerImpl.java:1907)
	at org.yaml.snakeyaml.scanner.ScannerImpl.scanFlowScalar(ScannerImpl.java:1841)
	at org.yaml.snakeyaml.scanner.ScannerImpl.fetchFlowScalar(ScannerImpl.java:1027)
	at org.yaml.snakeyaml.scanner.ScannerImpl.fetchDouble(ScannerImpl.java:1009)
	at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:394)
	at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:227)
	at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingValue.produce(ParserImpl.java:586)
	at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
	at org.yaml.snakeyaml.Yaml$3.hasNext(Yaml.java:711)
	at org.yaml.editor.Snake2Events.yamlToEvents(Snake2Events.java:111)
	at org.yaml.editor.Snake2Events.main(Snake2Events.java:119)

java-json

 error
Exception in thread "main" while scanning a double-quoted scalar
 in 'reader', line 1, column 16:
    escaped slash: "a\/b"
                   ^
found unknown escape character /(47)
 in 'reader', line 1, column 19:
    escaped slash: "a\/b"
                      ^

	at org.yaml.snakeyaml.scanner.ScannerImpl.scanFlowScalarNonSpaces(ScannerImpl.java:1907)
	at org.yaml.snakeyaml.scanner.ScannerImpl.scanFlowScalar(ScannerImpl.java:1841)
	at org.yaml.snakeyaml.scanner.ScannerImpl.fetchFlowScalar(ScannerImpl.java:1027)
	at org.yaml.snakeyaml.scanner.ScannerImpl.fetchDouble(ScannerImpl.java:1009)
	at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:394)
	at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:227)
	at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingValue.produce(ParserImpl.java:586)
	at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
	at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:124)
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:236)
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:227)
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:215)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:144)
	at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:85)
	at org.yaml.snakeyaml.constructor.BaseConstructor.getData(BaseConstructor.java:123)
	at org.yaml.snakeyaml.Yaml$1.next(Yaml.java:547)
	at org.yaml.editor.Snake2Json.yamlToJson(Snake2Json.java:18)
	at org.yaml.editor.Snake2Json.main(Snake2Json.java:25)

luajit-json

 error
luajit: found unknown escape character at document: 1, line: 1, column: 18
while parsing a quoted scalar at line: 1, column: 16

stack traceback:
	[C]: in function 'load'
	/bin/luajit-json:6: in main chunk
	[C]: at 0x004044a0

ruby-json

 error
/usr/lib/ruby/2.3.0/psych.rb:380:in `parse': (<unknown>): found unknown escape character while parsing a quoted scalar at line 1 column 16 (Psych::SyntaxError)
	from /usr/lib/ruby/2.3.0/psych.rb:380:in `parse_stream'
	from /usr/lib/ruby/2.3.0/psych.rb:463:in `load_stream'
	from /bin/ruby-json:6:in `<main>'

perl5-pm-pl

 na
{
  'escaped slash' => 'a\\/b'
}

perl5-pp-pl

 na
{
  'escaped slash' => 'a/b'
}

perl5-syck-pl

 na
{
  'escaped slash' => 'a\\/b'
}

perl5-tiny-pl

 na
{
  'escaped slash' => 'a\\/b'
}

perl5-xs-pl

 na
{
  'escaped slash' => 'a/b'
}

pyyaml-py

 na
{'escaped slash': 'a/b'}

ruamel-py

 na
{'escaped slash': 'a/b'}