Skip to main content

get_test.go

get_test.go - Overview

This file contains tests for the GET command in the Ironhawk in-memory data store.

Detailed Documentation

TestGET Function

Purpose: Tests the functionality of the GET command, including cases with and without expiration, non-existent keys, and incorrect number of arguments.

Parameters:

  • t (*testing.T): Testing context provided by the Go testing framework.

Returns: None

The test cases cover the following scenarios:

  • Retrieving a value after setting it with an expiration time, and verifying that it expires correctly.
  • Retrieving a value after setting it without an expiration time.
  • Attempting to retrieve a value for a non-existent key.
  • Calling the GET command with an incorrect number of arguments.

The runTestcases function (not defined in this file) is assumed to execute the commands against the client and verify the results.

Getting Started Relevance: NO