22 lines
539 B
Smalltalk
22 lines
539 B
Smalltalk
|
"
|
||
|
A BreaQueryTest is a test class for testing the behavior of BreaQuery
|
||
|
"
|
||
|
Class {
|
||
|
#name : #BreaQueryTest,
|
||
|
#superclass : #TestCase,
|
||
|
#category : #'Brea-Tests'
|
||
|
}
|
||
|
|
||
|
{ #category : #tests }
|
||
|
BreaQueryTest >> testSTONSerialization [
|
||
|
|
||
|
| original store deserialized |
|
||
|
original := BreaQuery new
|
||
|
name: 'plus';
|
||
|
inputs: {'a' -> 3. 'b' -> 4} asDictionary;
|
||
|
codeBlock: [ :x :y | x + y ].
|
||
|
store := STON toString: original.
|
||
|
deserialized := (STONReader on: store readStream) next.
|
||
|
self assert: original execute equals: deserialized execute
|
||
|
]
|