MCPcopy Create free account
hub / github.com/codechenx/FastTableViewer / TestI2B

Function TestI2B

utils_test.go:11–32  ·  view source on GitHub ↗

======================================== Type Conversion Tests ========================================

(t *testing.T)

Source from the content-addressed store, hash-verified

9// ========================================
10
11func TestI2B(t *testing.T) {
12 type args struct {
13 i int
14 }
15 tests := []struct {
16 name string
17 args args
18 want bool
19 }{
20 {"Positive number 1", args{i: 1}, true},
21 {"Positive number 2", args{i: 2}, true},
22 {"Zero value", args{i: 0}, false},
23 {"Negative value", args{i: -1}, false},
24 }
25 for _, tt := range tests {
26 t.Run(tt.name, func(t *testing.T) {
27 if got := I2B(tt.args.i); got != tt.want {
28 t.Errorf("I2B() = %v, want %v", got, tt.want)
29 }
30 })
31 }
32}
33
34func TestI2S_Basic(t *testing.T) {
35 result := I2S(42)

Callers

nothing calls this directly

Calls 1

I2BFunction · 0.85

Tested by

no test coverage detected