Skip to main content

set_data_cmd_test.go - Overview

This file contains tests for the set data commands (SADD, SCARD, SMEMBERS, SREM) in the ironhawk package.

Detailed Documentation

CustomDeepEqual

func CustomDeepEqual(t *testing.T, a, b interface{})

Purpose: This function compares two interfaces for deep equality, with a special case for slices of any to ensure order doesn't matter.

Parameters:

  • t: *testing.T - The testing object for reporting errors.
  • a: interface{} - The first interface to compare.
  • b: interface{} - The second interface to compare.

Returns: This function does not return anything directly, but reports errors via t.Fatalf if the interfaces are not deeply equal, after potentially sorting slices of any.

TestSetDataCommand

func TestSetDataCommand(t *testing.T)

Purpose: This function tests the functionality of set data commands (SADD, SCARD, SMEMBERS, SREM) by sending a series of commands to a local ironhawk client and comparing the results with expected values.

Parameters:

  • t: *testing.T - The testing object for reporting errors.

Returns: This function does not return anything directly, but reports errors via t.Error if the commands do not produce the expected results.

Getting Started Relevance