Skip to content

Commit

Permalink
test: validate UTF8 payloads
Browse files Browse the repository at this point in the history
  • Loading branch information
romanzac committed Nov 14, 2023
1 parent 0a27187 commit a43a723
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions waku/v2/protocol/filter/filter_push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import (
"time"
)

// Test valid payloads

func (s *FilterTestSuite) TestValidaPayloadsASCII() {
func (s *FilterTestSuite) TestValidPayloadsASCII() {

// Create test context
s.ctx, s.ctxCancel = context.WithTimeout(context.Background(), 20*time.Second)
Expand All @@ -28,3 +26,24 @@ func (s *FilterTestSuite) TestValidaPayloadsASCII() {
s.Require().NoError(err)

}

func (s *FilterTestSuite) TestValidPayloadsUTF8() {

// Create test context
s.ctx, s.ctxCancel = context.WithTimeout(context.Background(), 20*time.Second)

// Subscribe
s.subDetails = s.subscribe(s.testTopic, s.testContentTopic, s.fullNodeHost.ID())

// Prepare basic data
messages := prepareData(100, false, false, true, tests.GenerateRandomUTF8String)

// All messages should be received
s.waitForMessages(func() {
s.publishMessages(messages)
}, s.subDetails, messages)

_, err := s.lightNode.UnsubscribeAll(s.ctx)
s.Require().NoError(err)

}

0 comments on commit a43a723

Please sign in to comment.