[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

test[sharing] VSE-S8 01 literals

Reading tests of well known VSE literals.

Stringifier @ nil

"Reading nil"
 '{"id":1,"origin":"VSE","contents":null}' asObject notNil ifTrue: [ self error: 'Must be nil' ].

Stringifier @ #hello

"Reading #hello"
 '{"id":1,"origin":"VSE","contents":"hello"}' asObject ~= #hello ifTrue: [ self error: 'Wrong result' ].

Stringifier @ 123

"Reading 123"
 '{"id":1,"origin":"VSE","contents":123}' asObject ~= 123 ifTrue: [ self error: 'Wrong result' ].

Stringifier @ 0

"Reading 0"
 '{"id":1,"origin":"VSE","contents":0}' asObject ~= 0 ifTrue: [ self error: 'Wrong result' ].

Stringifier @ 0.123

"Reading 0.123"
 '{"id":1,"origin":"VSE","contents":0.123}' asObject ~= 0.123 ifTrue: [ self error: 'Wrong result' ].

Stringifier @ Point

"Reading a Class"
 '{"id":2,"origin":"VSE","contents":{"id":2,"global":"Point","allInstVarNames":["x","y"]}}' asObject ~= Point ifTrue: [ self error: 'Wrong result' ].

Stringifier @ Point class

"Reading a Metaclass"
 '{"id":2,"origin":"VSE","contents":{"id":2,"global":["Point","class"],"allInstVarNames":["superClass","dictionaryArray","structure","name","comment","subclasses","instances","classPool","sharedPools"]}}' asObject ~= Point class ifTrue: [ self error: 'Wrong result' ].

Stringifier @ true

"Reading true"
 '{"id":1,"origin":"VSE","contents":true}' asObject ~= true ifTrue: [ self error: 'Wrong result' ].

Stringifier @ #(1 2 three 123)

"Reading anArray"
 '{"id":3,"origin":"VSE","contents":{"id":2,"contents":[1,2,"three",123],"class":{"id":3,"global":"Array"}}}' asObject ~= #(1 2 three 123) ifTrue: [ self error: 'Wrong result' ].