MCPcopy Create free account
hub / github.com/cogentcore/core / assertAlmostEqual

Function assertAlmostEqual

texteditor/difflib/difflib_test.go:15–19  ·  view source on GitHub ↗
(t *testing.T, a, b float64, places int)

Source from the content-addressed store, hash-verified

13)
14
15func assertAlmostEqual(t *testing.T, a, b float64, places int) {
16 if math.Abs(a-b) > math.Pow10(-places) {
17 t.Errorf("%.7f != %.7f", a, b)
18 }
19}
20
21func assertEqual(t *testing.T, a, b any) {
22 if !reflect.DeepEqual(a, b) {

Callers 2

TestWithAsciiOneInsertFunction · 0.70
TestWithAsciiOnDeleteFunction · 0.70

Calls 2

ErrorfMethod · 0.65
AbsMethod · 0.45

Tested by

no test coverage detected