Thanks, applied, with one minor tweak.
On Sep 15, 2006, at 9:07 AM, Nuno Carvalho via RT wrote:
Hi again,
Sorry, there was a problem with the last diff. Here's the most updated
patch, attached to this file, please igore the previous patch. Sorry
again.
Best regards,
./smash
On 9/15/06, Nuno Carvalho <[EMAIL PROTECTED]> wrote:
Hi again,
Added some more simple tests to file 't/compilers/json/to_parrot.t'
related to backslashing testing. All the new tests pass. Attached to
this message you can find the patch file.
Best regards,
./smash
Index: t/compilers/json/to_parrot.t
===================================================================
--- t/compilers/json/to_parrot.t (revision 14622)
+++ t/compilers/json/to_parrot.t (working copy)
@@ -6,7 +6,7 @@
use lib qw( t . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test tests => 52;
+use Parrot::Test tests => 60;
=head1 NAME
@@ -34,6 +34,56 @@
"JSON" => "json"
OUT
+json_isnt('a', 'strings need quotes');
+
+json_dump_is(<<'JSON', <<'OUT', 'string with backslash "');
+"\"json\""
+JSON
+"JSON" => "\"json\""
+OUT
+
+json_dump_is(<<'JSON', <<'OUT', 'string with backslash \\');
+"\\json\\"
+JSON
+"JSON" => "\\json\\"
+OUT
+
+json_dump_is(<<'JSON', <<'OUT', 'string with / (no backslash
required)');
+"/json/"
+JSON
+"JSON" => "/json/"
+OUT
+
+json_dump_is(<<'JSON', <<'OUT', 'string with backslash b');
+"\bjson\b"
+JSON
+"JSON" => "\bjson\b"
+OUT
+
+json_dump_is(<<'JSON', <<'OUT', 'string with backslash f');
+"\fjson\f"
+JSON
+"JSON" => "\fjson\f"
+OUT
+
+json_dump_is(<<'JSON', <<'OUT', 'string with backslash n');
+"\njson\n"
+JSON
+"JSON" => "\njson\n"
+OUT
+
+json_dump_is(<<'JSON', <<'OUT', 'string with backslash r');
+"\rjson\r"
+JSON
+"JSON" => "\rjson\r"
+OUT
+
+json_dump_is(<<'JSON', <<'OUT', 'string with backslash t');
+"\tjson\t"
+JSON
+"JSON" => "\tjson\t"
+OUT
+
json_dump_is(<<'JSON', <<'OUT', 'number int');
1
JSON
@@ -628,7 +678,6 @@
]
OUT
-json_isnt('a', 'strings need quotes');
# XXX Need many more tests, exercising all aspects of http://
www.json.org/
--
Will "Coke" Coleda
[EMAIL PROTECTED]