Discover Packages
github.com/naruse666/core
base
tolassert
package
Version:
v1.0.6
Opens a new window with list of versions in this module.
Published: Apr 10, 2025
License: BSD-3-Clause
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: ? modules, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
Jump to ...
Documentation
Overview
Index
Constants
Variables
Functions
Equal(t, expected, actual, msgAndArgs)
EqualTol(t, expected, actual, tolerance, msgAndArgs)
EqualTolSlice(t, expected, actual, tolerance, msgAndArgs)
Types
Source Files
Documentation
Documentation
¶
Package tolassert provides functions for asserting the equality of numbers
with tolerance (in other words, it checks whether numbers are about equal).
func Equal[T num.Float](t assert.TestingT, expected T, actual T, msgAndArgs ...any) bool
func EqualTol[T num.Float](t assert.TestingT, expected T, actual, tolerance T, msgAndArgs ...any) bool
func EqualTolSlice[T num.Float](t assert.TestingT, expected, actual []T, tolerance T, msgAndArgs ...any) bool
Equal asserts that the given two numbers are about equal to each other,
using a default tolerance of 0.001.
EqualTol asserts that the given two numbers are about equal to each other,
using the given tolerance value.
EqualTolSlice asserts that the given two slices of numbers are about equal to each other,
using the given tolerance value.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.