summaryrefslogtreecommitdiff
path: root/internal/num/signed_test.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-03-18 20:47:25 +0100
committerDimitri Sokolyuk <demon@dim13.org>2018-03-18 20:47:25 +0100
commit7405ae1ca49258e9fd777171062db56cc73647ae (patch)
tree821d56c3914a4b75d146f4dfec35fae7fd475b35 /internal/num/signed_test.go
parentadf0350662e3f875c92a37c7ca054c6a3964d45b (diff)
add numerical representations
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)
+ }
+ })
+ }
+}