-
Notifications
You must be signed in to change notification settings - Fork 4
/
code_test.go
44 lines (38 loc) · 1.04 KB
/
code_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package mymodule
import (
"reflect"
"testing"
)
// sample tests
func TestClone_int(t *testing.T) {
testName := "TestClone_int"
input := []int{1, 2, 3}
output := Clone(input)
if !reflect.DeepEqual(input, output) {
t.Fatalf("%s failed: expected %v but received %v", testName, input, output)
}
}
func TestClone_uint(t *testing.T) {
testName := "TestClone_uint"
input := []uint{4, 5, 6}
output := Clone(input)
if !reflect.DeepEqual(input, output) {
t.Fatalf("%s failed: expected %v but received %v", testName, input, output)
}
}
func TestClone_float(t *testing.T) {
testName := "TestClone_float"
input := []float64{7.8, 8.9, 9.0}
output := Clone(input)
if !reflect.DeepEqual(input, output) {
t.Fatalf("%s failed: expected %v but received %v", testName, input, output)
}
}
func TestClone_string(t *testing.T) {
testName := "TestClone_string"
input := []string{"string 1", "string 2", "string 3"}
output := Clone(input)
if !reflect.DeepEqual(input, output) {
t.Fatalf("%s failed: expected %v but received %v", testName, input, output)
}
}