countminsketch_test.go
countminsketch_test.go - Overview
This file contains tests for the Count-Min Sketch functionality, specifically testing the CMS.INITBYDIM
, CMS.INITBYPROB
, CMS.INFO
, CMS.INCRBY
, CMS.QUERY
, and CMS.MERGE
commands.
Detailed Documentation
TestCMSInitByDim
- Purpose: Tests the
CMS.INITBYDIM
command with various valid and invalid inputs. - Parameters:
t
:*testing.T
- Testing context.
- Returns: None
TestCMSInitByProb
- Purpose: Tests the
CMS.INITBYPROB
command with various valid and invalid inputs. - Parameters:
t
:*testing.T
- Testing context.
- Returns: None
TestCMSInfo
- Purpose: Tests the
CMS.INFO
command, verifying that it returns the correct information about the sketch. - Parameters:
t
:*testing.T
- Testing context.
- Returns: None
TestCMSIncrBy
- Purpose: Tests the
CMS.INCRBY
command, including error cases and value insertion. - Parameters:
t
:*testing.T
- Testing context.
- Returns: None
TestCMSQuery
- Purpose: Tests the
CMS.QUERY
command to ensure that it returns the correct counts. - Parameters:
t
:*testing.T
- Testing context.
- Returns: None
TestCMSMerge
- Purpose: Tests the
CMS.MERGE
command, including cases with and without weights. - Parameters:
t
:*testing.T
- Testing context.
- Returns: None
Getting Started Relevance