Skip to main content
Glama
actions_timing_test.go1.12 kB
package actions_test import ( sharedActions "lunar/shared-model/actions" "testing" "github.com/stretchr/testify/assert" ) func TestTimestampToStringFromInt64(t *testing.T) { // Create a sample timestamp in milliseconds timestamp := int64(1675789662000) // Call the TimestampToString function result := sharedActions.TimestampToStringFromInt64( timestamp) // Define the expected output expected := "2023-02-07T17:07:42Z" assert.Equal(t, result, expected) } func TestTimestampFromStringToInt64(t *testing.T) { // Create a sample timestamp string timestamp := "2023-02-07T17:07:42Z" // Call the TimestampFromString function result, err := sharedActions.TimestampFromStringToInt64( timestamp) // Define the expected output expected := int64(1675789662000) assert.Nil(t, err) assert.Equal(t, result, expected) } func TestTimestampFromStringToInt64WithInvalidTimestamp(t *testing.T) { // Create an invalid timestamp string timestamp := "invalid-timestamp" // Call the TimestampFromString function _, err := sharedActions.TimestampFromStringToInt64( timestamp) assert.NotNil(t, err) }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TheLunarCompany/lunar'

If you have feedback or need assistance with the MCP directory API, please join our Discord server