package cmp

import "github.com/ydb-platform/ydb-go-sdk/v3/internal/cmp"

Index

Functions

func Compare

func Compare(l, r value.V) (int, error)

Compare compares its operands. It returns -1, 0, 1 if l < r, l == r, l > r. Returns error if types are not comparable. Comparable types are all integer types, UUID, DyNumber, Float, Double, String, UTF8, Date, Datetime, Timestamp, Tuples and Lists. Primitive arguments are comparable if their types are the same. Optional types is comparable to underlying types, e.g. Optional<Optional<Float>> is comparable to Float. Null value is comparable to non-null value of the same types and is considered less than any non-null value. Tuples and Lists are comparable if their elements are comparable. Tuples and Lists are compared lexicographically. If tuples (lists) have different length and elements of the shorter tuple (list) are all equal to corresponding elements of the other tuple (list), than the shorter tuple (list) is considered less than the longer one.

func Equal

func Equal(t *testing.T, expected, actual interface{})

func NoError

func NoError(t *testing.T, err error)

func NotNil

func NotNil(t *testing.T, value interface{})

Source Files

assert.go compare.go

Version
v3.4.4
Published
Dec 9, 2021
Platform
linux/amd64
Imports
8 packages
Last checked
7 minutes ago

Tools for package owners.