summaryrefslogtreecommitdiff
path: root/internal/num/signed_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/num/signed_test.go')
-rw-r--r--internal/num/signed_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/num/signed_test.go b/internal/num/signed_test.go
new file mode 100644
index 0000000..19a82db
--- /dev/null
+++ b/internal/num/signed_test.go
@@ -0,0 +1,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)
+ }
+ })
+ }
+}