MCPcopy Create free account
hub / github.com/cockroachdb/apd / TestNeg

Function TestNeg

decimal_test.go:777–799  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

775}
776
777func TestNeg(t *testing.T) {
778 tests := map[string]string{
779 "0": "0",
780 "-0": "0",
781 "-0.000": "0.000",
782 "-00.000100": "0.000100",
783 }
784
785 for tc, expect := range tests {
786 t.Run(tc, func(t *testing.T) {
787 d, _, err := NewFromString(tc)
788 if err != nil {
789 t.Fatal(err)
790 }
791 var z Decimal
792 z.Neg(d)
793 s := z.String()
794 if s != expect {
795 t.Fatalf("expected %s, got %s", expect, s)
796 }
797 })
798 }
799}
800
801func TestReduce(t *testing.T) {
802 tests := map[string]int{

Callers

nothing calls this directly

Calls 4

NegMethod · 0.95
StringMethod · 0.95
NewFromStringFunction · 0.85
RunMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…