Redis Server Test Tool
This tool provides comprehensive testing for the Redis server implementation in the pkg/redisserver package.
Features
- Tests both TCP and Unix socket connections
- Organized test suites for different Redis functionality:
- Connection tests
- String operations
- Hash operations
- List operations
- Pattern matching
- Miscellaneous operations
 
- Detailed test results with pass/fail status and error information
- Summary statistics for overall test coverage
Usage
go run main.go [options]
Options
- -tcp-port string: Redis server TCP port (default "7777")
- -unix-socket string: Redis server Unix domain socket path (default "/tmp/redis-test.sock")
- -debug: Enable debug output (default false)
- -db int: Redis database number (default 0)
Example
# Run with default settings
go run main.go
# Run with custom port and socket
go run main.go -tcp-port 6379 -unix-socket /tmp/custom-redis.sock
# Run with debug output
go run main.go -debug
Test Coverage
The tool tests the following Redis functionality:
- 
Connection Tests - PING
- INFO
 
- 
String Operations - SET/GET
- SET with expiration
- TTL
- DEL
- EXISTS
- INCR
- TYPE
 
- 
Hash Operations - HSET/HGET
- HKEYS
- HLEN
- HDEL
- Type checking
 
- 
List Operations - LPUSH/RPUSH
- LLEN
- LRANGE
- LPOP/RPOP
- Type checking
 
- 
Pattern Matching - KEYS with various patterns
- SCAN with patterns
- Wildcard pattern matching
 
- 
Miscellaneous Operations - FLUSHDB
- Multiple sequential operations
- Non-existent key handling