Skip to content

Commit

Permalink
Added MessageId test
Browse files Browse the repository at this point in the history
  • Loading branch information
mumez committed Jun 5, 2024
1 parent 46a1594 commit 6dca07e
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 0 deletions.
5 changes: 5 additions & 0 deletions repository/RediStick-Stream-Objects-Tests.package/.filetree
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"separateMethodMetaAndSource" : false,
"noMethodMetaData" : true,
"useCypressPropertiesFile" : true
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
tests
testMessageId
| id1 id2 id3 |
self assert: RsStreamMessageId all asString equals: '0'.
self assert: RsStreamMessageId min asString equals: '-'.
self assert: RsStreamMessageId max asString equals: '+'.
self assert: RsStreamMessageId autoGenerated asString equals: '*'.
self assert: RsStreamMessageId neverDelivered asString equals: '>'.
self assert: RsStreamMessageId newest asString equals: '$'.
#(all min max autoGenerated neverDelivered newest) do: [ :sele |
self assert: (RsStreamMessageId perform: sele) equals: (RsStreamMessageId perform: sele).
].
id1 := RsStreamMessageId fromString: 'aaa-1'.
self assert: id1 equals:(RsStreamMessageId fromString: 'aaa-1').
self deny: id1 equals:(RsStreamMessageId fromString: 'aaa-2').
self assert: id1 mainId equals: 'aaa'.
self assert: id1 subId equals: '1'.
self assert: id1 isAutoSequence not.
id2 := RsStreamMessageId fromString: 'aaaaa'.
self assert: id2 mainId equals: 'aaaaa'.
self assert: id2 subId equals: nil.
self assert: id2 isAutoSequence not.
id3 := RsStreamMessageId idWithAutoSequence: 'bbbbb'.
self assert: id3 mainId equals: 'bbbbb'.
self assert: id3 subId equals: '*'.
self assert: id3 isAutoSequence
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "RsRedisTestCase",
"category" : "RediStick-Stream-Objects-Tests",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "RsRedisStreamObjectsTest",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
self packageOrganizer ensurePackage: #'RediStick-Stream-Objects-Tests' withTags: #()!
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(name 'RediStick-Stream-Objects-Tests')
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ }

0 comments on commit 6dca07e

Please sign in to comment.