summaryrefslogtreecommitdiff
path: root/internal/num/signed_test.go
blob: 19a82dbe527c654e97f636651f37b46320ca5c50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package num

import "testing"

func TestSigned(t *testing.T) {
	testCases := []struct {
		i Signed
		s string
	}{
		{0, ""},
		{1, "+1"},
		{-1, "-1"},
	}

	for _, tc := range testCases {
		t.Run(tc.s, func(t *testing.T) {
			if tc.i.String() != tc.s {
				t.Errorf("got %v, want %v", tc.i, tc.s)
			}
		})
	}
}