the option single_quotes in functions dealing with json inputs now allows json that uses single quotes to deliminate keys and strings to be processed, note that this changes the escaping rules slightly
This commit is contained in:
parent
1d5b9e7410
commit
97a7d295f1
2 changed files with 29 additions and 29 deletions
|
@ -148,7 +148,7 @@ single_quotes_test_() ->
|
|||
},
|
||||
{"single quote in double quoted string",
|
||||
?_assertEqual(
|
||||
to_term(<<"[\"a single quote: '\"]">>),
|
||||
to_term(<<"[\"a single quote: '\"]">>, [single_quotes]),
|
||||
[<<"a single quote: '">>]
|
||||
)
|
||||
},
|
||||
|
@ -163,6 +163,12 @@ single_quotes_test_() ->
|
|||
badarg,
|
||||
to_term(<<"[\"a single quote: \\'\"]">>)
|
||||
)
|
||||
},
|
||||
{"mismatched quotes",
|
||||
?_assertError(
|
||||
badarg,
|
||||
to_term(<<"['mismatched\"]">>, [single_quotes])
|
||||
)
|
||||
}
|
||||
].
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue