Skip to main content

hrandfield_test.go

hrandfield_test.go - Overview

This file contains tests for the HRANDFIELD command, verifying that it correctly retrieves random fields from a hash.

Detailed Documentation

TestHRANDFIELD

  • Purpose: Tests the HRANDFIELD command with various options, including count and WITHVALUES.
  • Parameters:
    • t: *testing.T - Testing context.
  • Returns: None

assertRandomFieldResult

  • Purpose: Asserts that the HRANDFIELD result contains all expected values or a single valid result.
  • Parameters:
    • t: *testing.T - Testing context.
    • result: interface{} - The result from the command.
    • expected: []string - List of expected string values.
  • Returns: None

Getting Started Relevance