Skip to content

Commit

Permalink
adjustments for compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
timfel committed Jun 15, 2010
1 parent 3b5e32c commit 2811f4e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion JSON/Json.st
Expand Up @@ -244,7 +244,7 @@ Object subclass: Json [
with: stream next with: stream next
with: stream next with: stream next
with: stream next) asUppercase. with: stream next) asUppercase.
^Unicode value: (Integer readFrom: string readStream base: 16) ^Character codePoint: (Integer readFrom: string readStream radix: 16)
] ]
ctorMap [ ctorMap [
Expand Down
39 changes: 21 additions & 18 deletions JSON/JsonTests.st
Expand Up @@ -55,14 +55,14 @@ TestCase subclass: JsonTests [
self json: '"\\"' equals: '\'. self json: '"\\"' equals: '\'.
self json: '""' equals: ''. self json: '""' equals: ''.
self json: '"a\u0004b"' self json: '"a\u0004b"'
equals: ( equals: (String from:
{$a. {$a.
Character value: 4. Character value: 4.
$b} as: String). $b}).
self json: '"a\nb"' equals: ( self json: '"a\nb"' equals: (String from:
{$a. {$a.
Character lf. Character lf.
$b} as: String) $b})
] ]


testAtomTrue [ testAtomTrue [
Expand Down Expand Up @@ -106,8 +106,10 @@ TestCase subclass: JsonTests [
] ]


testStringWithUnicode [ testStringWithUnicode [
self json: '"\u263A"' equals: (Unicode value: 9786) asString. self json: '"\u263A"'
self render: (Unicode value: 9786) asString equals: '"\u263A"' equals: (Character codePoint: 9786) asUnicodeString asString.
self render: (Character codePoint: 9786) asUnicodeString asString
equals: '"\u263A"'
] ]


testWriteAssociation [ testWriteAssociation [
Expand All @@ -123,14 +125,15 @@ TestCase subclass: JsonTests [
self render: '"' equals: '"\""'. self render: '"' equals: '"\""'.
self render: '\' equals: '"\\"'. self render: '\' equals: '"\\"'.
self render: 'hi' equals: '"hi"'. self render: 'hi' equals: '"hi"'.
self render: ( self render: (String from:
{$a. {$a.
Character lf. Character lf.
$b} as: String) equals: '"a\nb"'. $b})
self render: ( equals: '"a\nb"'.
{$a. self render: (String from:
Character value: 4. {$a.
$b} as: String) Character value: 4.
$b})
equals: '"a\u0004b"' equals: '"a\u0004b"'
] ]
] ]
Expand Down
6 changes: 1 addition & 5 deletions package.xml
@@ -1,11 +1,9 @@
<package> <package>
<!-- THIS FILE IS GENERATED! EDITS _WILL_ BE LOST ON UPDATE! --> <!-- THIS FILE IS GENERATED! EDITS _WILL_ BE LOST ON UPDATE! -->
<name>JSON</name> <name>JSON</name>
<namespace>JSON</namespace>
<test> <test>
<filein>JSON/JsonTests.st</filein> <filein>JSON/JsonTests.st</filein>
<sunit>JSON.JsonTests <sunit>JsonTests</sunit>
</sunit>
</test> </test>
<filein>Extensions/Association.st</filein> <filein>Extensions/Association.st</filein>
<filein>Extensions/Collection.st</filein> <filein>Extensions/Collection.st</filein>
Expand All @@ -19,7 +17,6 @@
<filein>Extensions/Number.st</filein> <filein>Extensions/Number.st</filein>
<filein>Extensions/Object.st</filein> <filein>Extensions/Object.st</filein>
<filein>Extensions/String.st</filein> <filein>Extensions/String.st</filein>
<filein>Extensions/Text.st</filein>
<filein>Extensions/True.st</filein> <filein>Extensions/True.st</filein>
<filein>Extensions/UndefinedObject.st</filein> <filein>Extensions/UndefinedObject.st</filein>
<filein>Extensions/WriteStream.st</filein> <filein>Extensions/WriteStream.st</filein>
Expand All @@ -36,7 +33,6 @@
<file>Extensions/Number.st</file> <file>Extensions/Number.st</file>
<file>Extensions/Object.st</file> <file>Extensions/Object.st</file>
<file>Extensions/String.st</file> <file>Extensions/String.st</file>
<file>Extensions/Text.st</file>
<file>Extensions/True.st</file> <file>Extensions/True.st</file>
<file>Extensions/UndefinedObject.st</file> <file>Extensions/UndefinedObject.st</file>
<file>Extensions/WriteStream.st</file> <file>Extensions/WriteStream.st</file>
Expand Down

0 comments on commit 2811f4e

Please sign in to comment.