RegressionTests__XMLCoderTests.st
author Jan Vrany <jan.vrany@labware.com>
Wed, 24 Nov 2021 11:34:33 +0000
branchjv
changeset 2605 06d49352dc54
parent 1974 f2eaf05205d6
permissions -rwxr-xr-x
Update `MakefileTests` to work with both in-tree and out-of-tree builds
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1974
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
     1
"
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
     2
 COPYRIGHT (c) Claus Gittinger / eXept Software AG
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
     3
 COPYRIGHT (c) 2016 Jan Vrany
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
     4
              All Rights Reserved
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
     5
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
     6
 This software is furnished under a license and may be used
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
     7
 only in accordance with the terms of that license and with the
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
     8
 inclusion of the above copyright notice.   This software may not
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
     9
 be provided or otherwise made available to, or used by, any
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
    10
 other person.  No title to or ownership of the software is
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
    11
 hereby transferred.
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
    12
"
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    13
"{ Package: 'stx:goodies/regression' }"
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    14
208
4db1efdbce2e Test UUID coding
Stefan Vogel <sv@exept.de>
parents: 166
diff changeset
    15
"{ NameSpace: RegressionTests }"
4db1efdbce2e Test UUID coding
Stefan Vogel <sv@exept.de>
parents: 166
diff changeset
    16
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    17
TestCase subclass:#XMLCoderTests
219
5c4ce125abf5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    18
	instanceVariableNames:''
5c4ce125abf5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    19
	classVariableNames:''
5c4ce125abf5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    20
	poolDictionaries:''
1551
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
    21
	category:'tests-Regression-XML'
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    22
!
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    23
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    24
!XMLCoderTests class methodsFor:'documentation'!
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    25
1974
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
    26
copyright
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
    27
"
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
    28
 COPYRIGHT (c) Claus Gittinger / eXept Software AG
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
    29
 COPYRIGHT (c) 2016 Jan Vrany
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
    30
              All Rights Reserved
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
    31
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
    32
 This software is furnished under a license and may be used
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
    33
 only in accordance with the terms of that license and with the
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
    35
 be provided or otherwise made available to, or used by, any
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
    36
 other person.  No title to or ownership of the software is
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
    37
 hereby transferred.
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
    38
"
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
    39
!
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
    40
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    41
documentation
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    42
"
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    43
    documentation to be added.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    44
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    45
    [author:]
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    46
	Stefan Vogel (stefan@zwerg)
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    47
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    48
    [see also:]
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    49
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    50
    [instance variables:]
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    51
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    52
    [class variables:]
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    53
"
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    54
! !
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    55
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    56
!XMLCoderTests methodsFor:'helpers'!
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    57
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    58
encodeAndDecode:anObject
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    59
    "test, that encoding and decoding an Object results in anObject"
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    60
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    61
    |encodedString decodedObject|
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    62
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    63
    encodedString := XMLStandardCoder new encodingOf:anObject.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    64
    decodedObject := (XMLStandardDecoder on:encodedString readStream) next.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    65
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    66
    self should:anObject = decodedObject.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    67
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    68
    encodedString := XMLStandardCoder new aspect:#encodeInstanceVariables; encodingOf:anObject.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    69
    decodedObject := (XMLStandardDecoder on:encodedString readStream) useSend:true; next.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    70
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    71
    self should:anObject = decodedObject.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    72
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    73
    ^ decodedObject.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    74
! !
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    75
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    76
!XMLCoderTests methodsFor:'initialize / release'!
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    77
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    78
setUp
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    79
    "common setup - invoked before testing"
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    80
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    81
    super setUp
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    82
!
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    83
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    84
tearDown
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    85
    "common cleanup - invoked after testing"
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    86
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    87
    super tearDown
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    88
! !
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    89
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    90
!XMLCoderTests methodsFor:'tests'!
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    91
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    92
testArray
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    93
    "test encoding an decoding of an integer"
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    94
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    95
    |arr|
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    96
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    97
    arr := Array new:10.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    98
    arr at:1 put:true.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    99
    arr at:2 put:'hallo'.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   100
    arr at:3 put:#symbol.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   101
    arr at:4 put:nil.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   102
"/    arr at:6 put:arr.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   103
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   104
    self encodeAndDecode:arr
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   105
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   106
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   107
     self run:#testArray
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   108
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   109
!
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   110
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   111
testBytes
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   112
    "test encoding an decoding of an ByteArray"
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   113
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   114
    self encodeAndDecode:#[1].
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   115
    self encodeAndDecode:#[1 2].
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   116
    self encodeAndDecode:#[1 2 3].
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   117
    self encodeAndDecode:#[1 2 3 4].
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   118
    self encodeAndDecode:#[1 2 3 4 5].
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   119
    self encodeAndDecode:#[1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 9 0 12 3 4 56 7 8 9 0].
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   120
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   121
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   122
     self run:#testBytes
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   123
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   124
!
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   125
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   126
testCharacter
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   127
    "test encoding an decoding of a Character"
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   128
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   129
    self encodeAndDecode:$a.
1499
26a16a04219b Package renamed from exept:regression to stx:goodies/regression. Hooray!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 219
diff changeset
   130
    self encodeAndDecode:$.
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   131
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   132
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   133
     self run:#testCharacter
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   134
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   135
!
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   136
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   137
testComplex
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   138
    "test encoding an decoding of an OrderedCollection"
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   139
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   140
    |coll r decodedObject|
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   141
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   142
    coll := OrderedCollection new.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   143
    coll add:true.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   144
    coll add:'hallo'.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   145
    coll add:#symbol.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   146
    coll add:(r:= #[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23]).
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   147
    coll add:#symbol.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   148
    coll add:r.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   149
    coll add:coll copy.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   150
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   151
    decodedObject := self encodeAndDecode:coll.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   152
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   153
    self should:(decodedObject at:4) == (decodedObject at:6).
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   154
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   155
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   156
     self run:#testComplex
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   157
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   158
!
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   159
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   160
testDictionary
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   161
    "test encoding an decoding of an integer"
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   162
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   163
    |dict|
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   164
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   165
    dict := Dictionary new.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   166
    dict at:true put:1234.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   167
    dict at:#murks put:'hallo'.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   168
    dict at:5 put:#symbol.
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   169
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   170
    self encodeAndDecode:dict
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   171
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   172
    "
164
fcc68d8814ad *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   173
     self run:#testDictionary
fcc68d8814ad *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   174
    "
fcc68d8814ad *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   175
!
fcc68d8814ad *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   176
fcc68d8814ad *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   177
testEmptyCollection
fcc68d8814ad *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   178
    "test encoding an decoding of an OrderedCollection"
fcc68d8814ad *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   179
fcc68d8814ad *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   180
    |set|
fcc68d8814ad *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   181
fcc68d8814ad *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   182
    set := OrderedCollection new.
fcc68d8814ad *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   183
fcc68d8814ad *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   184
    self encodeAndDecode:set
fcc68d8814ad *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   185
fcc68d8814ad *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   186
    "
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   187
     self run:#testEmptyCollection
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   188
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   189
!
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   190
217
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   191
testFloat
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   192
    "test encoding an decoding of an integer"
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   193
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   194
    -1.0 to: 1.0 by:0.5 do:[:i|
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   195
	self encodeAndDecode:i
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   196
    ].
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   197
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   198
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   199
     self run:#testFloat
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   200
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   201
!
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   202
217
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   203
testFraction
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   204
    "test encoding an decoding of an integer"
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   205
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   206
    (-3/4) to:(3/4) by:(1/4) do:[:i|
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   207
	self encodeAndDecode:i
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   208
    ].
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   209
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   210
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   211
     self run:#testFraction
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   212
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   213
!
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   214
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   215
testIdentityDictionary
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   216
    "test encoding an decoding of an integer"
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   217
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   218
    |dict|
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   219
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   220
    dict := IdentityDictionary new.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   221
    dict at:true put:1234.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   222
    dict at:#test put:'hallo'.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   223
    dict at:5 put:#symbol.
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   224
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   225
    self encodeAndDecode:dict
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   226
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   227
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   228
     self run:#testIdentityDictionary
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   229
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   230
!
218
b21391af6f68 removed container
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   231
b21391af6f68 removed container
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   232
testInteger
b21391af6f68 removed container
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   233
    "test encoding an decoding of an integer"
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   234
219
5c4ce125abf5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   235
    #( 0 1 10 100 1000 10000 100000 1000000 16rFFFF 16rFFFFFF) do:[:i|
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   236
	self encodeAndDecode:i.
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   237
	self encodeAndDecode:i negated.
218
b21391af6f68 removed container
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   238
    ].
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   239
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   240
    "
219
5c4ce125abf5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   241
     self run:#testInteger
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   242
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   243
!
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   244
166
79ff0709dccb #encodeInterval
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
   245
testInterval
79ff0709dccb #encodeInterval
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
   246
    "test encoding an decoding of a set"
79ff0709dccb #encodeInterval
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
   247
79ff0709dccb #encodeInterval
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
   248
    |interval|
79ff0709dccb #encodeInterval
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
   249
79ff0709dccb #encodeInterval
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
   250
    interval := Interval from:1 to:100.
79ff0709dccb #encodeInterval
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
   251
79ff0709dccb #encodeInterval
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
   252
    self encodeAndDecode:interval
79ff0709dccb #encodeInterval
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
   253
79ff0709dccb #encodeInterval
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
   254
    "
79ff0709dccb #encodeInterval
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
   255
     self run:#testInterval
79ff0709dccb #encodeInterval
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
   256
    "
79ff0709dccb #encodeInterval
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
   257
!
79ff0709dccb #encodeInterval
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
   258
217
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   259
testLargeInteger
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   260
    "test encoding an decoding of an integer"
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   261
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   262
    #(
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   263
       16r1FFFFFFF 16r20000000
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   264
       16r3FFFFFFF 16r40000000
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   265
       16r7FFFFFFF 16r80000000
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   266
       16rFFFFFFFF 16r100000000
217
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   267
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   268
       16r1FFFFFFFF 16r200000000
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   269
       16r3FFFFFFFF 16r400000000
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   270
       16r7FFFFFFFF 16r800000000
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   271
       16rFFFFFFFFF 16r1000000000
217
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   272
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   273
       16r1FFFFFFFFF 16r2000000000
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   274
       16r3FFFFFFFFF 16r4000000000
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   275
       16r7FFFFFFFFF 16r8000000000
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   276
       16rFFFFFFFFFF 16r10000000000
217
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   277
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   278
       16r1FFFFFFFFFF 16r20000000000
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   279
       16r3FFFFFFFFFF 16r40000000000
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   280
       16r7FFFFFFFFFF 16r80000000000
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   281
       16rFFFFFFFFFFF 16r100000000000
217
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   282
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   283
       16r1FFFFFFFFFFF 16r200000000000
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   284
       16r3FFFFFFFFFFF 16r400000000000
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   285
       16r7FFFFFFFFFFF 16r800000000000
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   286
       16rFFFFFFFFFFFF 16r1000000000000
217
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   287
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   288
       16r1FFFFFFFFFFFFFF 16r200000000000000
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   289
       16r3FFFFFFFFFFFFFF 16r400000000000000
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   290
       16r7FFFFFFFFFFFFFF 16r800000000000000
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   291
       16rFFFFFFFFFFFFFFF 16r1000000000000000
217
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   292
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   293
    ) do:[:i|
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   294
	self encodeAndDecode:i.
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   295
	self encodeAndDecode:i negated.
217
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   296
    ].
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   297
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   298
    "
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   299
     self run:#testLargeInteger
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   300
     self basicNew testLargeInteger
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   301
    "
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   302
!
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   303
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   304
testOrderedCollection
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   305
    "test encoding an decoding of an OrderedCollection"
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   306
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   307
    |set|
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   308
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   309
    set := OrderedCollection new.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   310
    set add:true.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   311
    set add:'hallo'.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   312
    set add:#symbol.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   313
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   314
    self encodeAndDecode:set
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   315
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   316
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   317
     self run:#testOrderedCollection
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   318
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   319
!
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   320
217
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   321
testPoint
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   322
    "test encoding an decoding of a point"
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   323
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   324
    -4 to:4 do:[:x |
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   325
	-4 to:4 do:[:y |
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   326
	    self encodeAndDecode:(x @ y)
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   327
	]
217
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   328
    ].
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   329
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   330
    "
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   331
     self run:#testPoint
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   332
    "
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   333
!
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   334
1551
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   335
testRecursiveArray
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   336
    |arr encodedString decodedObject|
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   337
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   338
    arr := Array new:3.
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   339
    arr at:1 put:1.
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   340
    arr at:2 put:arr.
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   341
    arr at:3 put:3.
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   342
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   343
    encodedString := XMLStandardCoder new encodingOf:arr.
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   344
    decodedObject := (XMLStandardDecoder on:encodedString readStream) next.
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   345
    self assert:(decodedObject at:1) == 1.
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   346
    self assert:(decodedObject at:3) == 3.
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   347
    self assert:(decodedObject at:2) == decodedObject.
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   348
    "
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   349
     self run:#testRecursiveArray
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   350
    "
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   351
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   352
!
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   353
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   354
testSet
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   355
    "test encoding an decoding of a set"
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   356
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   357
    |set|
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   358
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   359
    set := Set new.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   360
    set add:true.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   361
    set add:'hallo'.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   362
    set add:#symbol.
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   363
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   364
    self encodeAndDecode:set
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   365
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   366
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   367
     self run:#testSet
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   368
    "
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   369
!
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   370
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   371
testString
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   372
    "test encoding an decoding of a String"
165
b9dba6743d09 Test tabs in strings
Stefan Vogel <sv@exept.de>
parents: 164
diff changeset
   373
217
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   374
    self encodeAndDecode:'hello world'.
1499
26a16a04219b Package renamed from exept:regression to stx:goodies/regression. Hooray!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 219
diff changeset
   375
    self encodeAndDecode:'hello world #*'.
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   376
    self encodeAndDecode:Character tab asString , 'with',
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   377
			 Character tab asString, Character tab asString, 'tabs',
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   378
			 Character tab asString.
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   379
    self encodeAndDecode:Character tab asString , '& with',
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   380
			 Character tab asString, Character tab asString, 'tabs',
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   381
			 Character tab asString.
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   382
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   383
    "
208
4db1efdbce2e Test UUID coding
Stefan Vogel <sv@exept.de>
parents: 166
diff changeset
   384
     self run:#testString
4db1efdbce2e Test UUID coding
Stefan Vogel <sv@exept.de>
parents: 166
diff changeset
   385
    "
4db1efdbce2e Test UUID coding
Stefan Vogel <sv@exept.de>
parents: 166
diff changeset
   386
!
4db1efdbce2e Test UUID coding
Stefan Vogel <sv@exept.de>
parents: 166
diff changeset
   387
4db1efdbce2e Test UUID coding
Stefan Vogel <sv@exept.de>
parents: 166
diff changeset
   388
testUUID
4db1efdbce2e Test UUID coding
Stefan Vogel <sv@exept.de>
parents: 166
diff changeset
   389
    "test encoding an decoding of an ByteArray"
4db1efdbce2e Test UUID coding
Stefan Vogel <sv@exept.de>
parents: 166
diff changeset
   390
4db1efdbce2e Test UUID coding
Stefan Vogel <sv@exept.de>
parents: 166
diff changeset
   391
    self encodeAndDecode:UUID genUUID.
4db1efdbce2e Test UUID coding
Stefan Vogel <sv@exept.de>
parents: 166
diff changeset
   392
4db1efdbce2e Test UUID coding
Stefan Vogel <sv@exept.de>
parents: 166
diff changeset
   393
    "
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   394
     self run:#testUUID
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   395
    "
1551
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   396
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   397
! !
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   398
217
f56519905d1d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   399
!XMLCoderTests class methodsFor:'documentation'!
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   400
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   401
version
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   402
    ^ '$Header$'
1974
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
   403
!
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
   404
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
   405
version_HG
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
   406
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1564
diff changeset
   407
    ^ '$Changeset: <not expanded> $'
163
fa9f1ff26607 initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   408
! !
1551
518cd60e66f8 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
   409