Skip to content

Commit

Permalink
STON test cases should end with Test instead of Tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jecisc committed Aug 3, 2019
1 parent 5f48771 commit 928b63d
Show file tree
Hide file tree
Showing 10 changed files with 162 additions and 162 deletions.
@@ -1,11 +1,11 @@
Class {
#name : #STONCStyleCommentsSkipStreamTests,
#name : #STONCStyleCommentsSkipStreamTest,
#superclass : #TestCase,
#category : #'STON-Tests-Utilities'
}

{ #category : #testing }
STONCStyleCommentsSkipStreamTests >> testCommentInString [
STONCStyleCommentsSkipStreamTest >> testCommentInString [
self
assert: (STONCStyleCommentsSkipStream on: '''/*comment*/''' readStream) upToEnd
equals: '''/*comment*/'''.
Expand All @@ -24,7 +24,7 @@ STONCStyleCommentsSkipStreamTests >> testCommentInString [
]

{ #category : #testing }
STONCStyleCommentsSkipStreamTests >> testMultiLineComment [
STONCStyleCommentsSkipStreamTest >> testMultiLineComment [
self
assert: (STONCStyleCommentsSkipStream on: 'foo\//comment\bar' withCRs readStream) upToEnd
equals: 'foo\bar' withCRs.
Expand All @@ -38,15 +38,15 @@ STONCStyleCommentsSkipStreamTests >> testMultiLineComment [
]

{ #category : #testing }
STONCStyleCommentsSkipStreamTests >> testNonComment [
STONCStyleCommentsSkipStreamTest >> testNonComment [
self assert: (STONCStyleCommentsSkipStream on: 'foo' readStream) upToEnd equals: 'foo'.
self assert: (STONCStyleCommentsSkipStream on: 'foo' readStream) nextLine equals: 'foo'.
self deny: (STONCStyleCommentsSkipStream on: 'foo' readStream) atEnd.
self assert: (STONCStyleCommentsSkipStream on: '' readStream) atEnd.
]

{ #category : #testing }
STONCStyleCommentsSkipStreamTests >> testSTON [
STONCStyleCommentsSkipStreamTest >> testSTON [
"Comments are processed first and totally removed.
They are not even whitespace (not that whitespace is relevant in STON)."

Expand All @@ -66,7 +66,7 @@ STONCStyleCommentsSkipStreamTests >> testSTON [
]

{ #category : #testing }
STONCStyleCommentsSkipStreamTests >> testSingleLineComment [
STONCStyleCommentsSkipStreamTest >> testSingleLineComment [
self assert: (STONCStyleCommentsSkipStream on: 'foo/*comment*/bar' readStream) upToEnd equals: 'foobar'.
self assert: (STONCStyleCommentsSkipStream on: 'foo/*comment*/bar' readStream) nextLine equals: 'foobar'.
self deny: (STONCStyleCommentsSkipStream on: 'foo/*comment*/bar' readStream) atEnd.
Expand Down
Expand Up @@ -2,21 +2,21 @@
STONJSONTests contains unit tests for the JSON functionality available in STON.
"
Class {
#name : #STONJSONTests,
#name : #STONJSONTest,
#superclass : #TestCase,
#category : #'STON-Tests-Base'
}

{ #category : #tests }
STONJSONTests >> testBooleans [
STONJSONTest >> testBooleans [
self assert: (STONJSON toString: true) equals: 'true'.
self assert: (STONJSON toString: false) equals: 'false'.
self assert: (STONJSON fromString: 'true') equals: true.
self assert: (STONJSON fromString: 'false') equals: false.
]

{ #category : #tests }
STONJSONTests >> testCircular [
STONJSONTest >> testCircular [
"Circular datastructures cannot be encoded using JSON"
self
should: [ | foo |
Expand All @@ -27,7 +27,7 @@ STONJSONTests >> testCircular [
]

{ #category : #tests }
STONJSONTests >> testFloats [
STONJSONTest >> testFloats [
self assert: (STONJSON toString: 1.0) equals: '1.0'.
self assert: (STONJSON toString: 0.0) equals: '0.0'.
self assert: (STONJSON toString: -1.0) equals: '-1.0'.
Expand All @@ -39,7 +39,7 @@ STONJSONTests >> testFloats [
]

{ #category : #tests }
STONJSONTests >> testIntegers [
STONJSONTest >> testIntegers [
self assert: (STONJSON toString: 1) equals: '1'.
self assert: (STONJSON toString: 0) equals: '0'.
self assert: (STONJSON toString: -1) equals: '-1'.
Expand All @@ -51,7 +51,7 @@ STONJSONTests >> testIntegers [
]

{ #category : #tests }
STONJSONTests >> testLists [
STONJSONTest >> testLists [
self assert: (STONJSON toString: #(1 2 3)) equals: '[1,2,3]'.
self assert: (STONJSON toString: #(1 -2 true 3 nil)) equals: '[1,-2,true,3,null]'.
self assert: (STONJSON toString: #(1 (2) 3)) equals: '[1,[2],3]'.
Expand All @@ -63,21 +63,21 @@ STONJSONTests >> testLists [
]

{ #category : #tests }
STONJSONTests >> testMaps [
STONJSONTest >> testMaps [
self assert: (STONJSON toString: { 'temperature'->37 } asDictionary) equals: '{"temperature":37}'.
self assert: (STONJSON toString: Dictionary new) equals: '{}'.
self assert: (STONJSON fromString: '{"temperature":37}') equals: { 'temperature'->37 } asDictionary.
self assert: (STONJSON fromString: '{}') equals: Dictionary new.
]

{ #category : #tests }
STONJSONTests >> testNull [
STONJSONTest >> testNull [
self assert: (STONJSON toString: nil) equals: 'null'.
self assert: (STONJSON fromString: 'null') equals: nil.
]

{ #category : #tests }
STONJSONTests >> testShared [
STONJSONTest >> testShared [
"Structure sharing cannot be encoded using JSON"
self
should: [ | foo |
Expand All @@ -87,7 +87,7 @@ STONJSONTests >> testShared [
]

{ #category : #tests }
STONJSONTests >> testStrings [
STONJSONTest >> testStrings [
self assert: (STONJSON toString: 'string') equals: '"string"'.
self assert: (STONJSON toString: '') equals: '""'.
self assert: (STONJSON toString: 'élèves français') equals: '"élèves français"'.
Expand All @@ -101,7 +101,7 @@ STONJSONTests >> testStrings [
]

{ #category : #tests }
STONJSONTests >> testUnknown [
STONJSONTest >> testUnknown [
"Only Array for lists and Dictionary for maps are allowed for JSON encoding,
any other Smalltalk object cannot be encoded (following the specs).
Even considering all collections to be lists won't work because the type
Expand Down
Expand Up @@ -2,21 +2,21 @@
STONLargeWriteReadTests test the optimalizations for large structures.
"
Class {
#name : #STONLargeWriteReadTests,
#superclass : #STONWriteReadTests,
#name : #STONLargeWriteReadTest,
#superclass : #STONWriteReadTest,
#category : #'STON-Tests-Writer'
}

{ #category : #private }
STONLargeWriteReadTests >> materialize: string [
STONLargeWriteReadTest >> materialize: string [
^ STON reader
on: string readStream;
optimizeForLargeStructures;
next
]

{ #category : #private }
STONLargeWriteReadTests >> serialize: anObject [
STONLargeWriteReadTest >> serialize: anObject [
^ String streamContents: [ :stream |
STON writer
on: stream;
Expand All @@ -25,7 +25,7 @@ STONLargeWriteReadTests >> serialize: anObject [
]

{ #category : #private }
STONLargeWriteReadTests >> serializeJson: anObject [
STONLargeWriteReadTest >> serializeJson: anObject [
^ String streamContents: [ :stream |
STON jsonWriter
on: stream;
Expand Down

0 comments on commit 928b63d

Please sign in to comment.