We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54cfe62 commit 681bd65Copy full SHA for 681bd65
cmd/algocfg/getCommand_test.go
@@ -0,0 +1,41 @@
1
+package main
2
+
3
+import (
4
+ "bytes"
5
+ "fmt"
6
+ "testing"
7
+ "time"
8
9
+ "github.com/stretchr/testify/assert"
10
+)
11
12
+func TestPrint(t *testing.T) {
13
+ testcases := []struct {
14
+ input interface{}
15
+ expected string
16
+ }{
17
+ {
18
+ input: uint64(1234),
19
+ expected: "1234",
20
+ },
21
22
+ input: int64(-1234),
23
+ expected: "-1234",
24
25
26
+ input: true,
27
+ expected: "true",
28
29
30
+ input: time.Second,
31
+ expected: "1s",
32
33
+ }
34
+ for i, tc := range testcases {
35
+ t.Run(fmt.Sprintf("test %d", i), func(t *testing.T) {
36
+ var buf bytes.Buffer
37
+ fmt.Fprintf(&buf, "%v", tc.input)
38
+ assert.Equal(t, tc.expected, buf.String())
39
+ })
40
41
+}
0 commit comments