-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathconfig_test.go
More file actions
44 lines (38 loc) · 1.02 KB
/
config_test.go
File metadata and controls
44 lines (38 loc) · 1.02 KB
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 main
import (
"testing"
"fmt"
"os"
)
var err error
var conf *Config
func TestReadConfig(t *testing.T) {
// func ReadConfig(path string) (conf *Config, err error)
fmt.Println("Testing Read Config")
conf, err = ReadConfig("conf.json.example")
if err != nil {
t.Errorf("Could not read config: %s", err)
}
}
func TestWriteConfig(t *testing.T) {
// func WriteConfig(conf *Config, path string) (err error)
fmt.Println("Testing Write Config")
err = WriteConfig(conf, "conf.write.test")
if err != nil {
t.Errorf("Could not write config: %s", err)
}
err = os.Remove("conf.write.test")
if err != nil {
t.Errorf("Could not delete test config: %s", err)
}
}
func TestMarshalJSON(t *testing.T) {
// func (d Duration) MarshalJSON() ([]byte, error)
}
func TestUnmarshalJSON(t *testing.T) {
// There are two funcs for UnmarshallJSON, so this test func
// will test them both rather than having two more test funcs
//
// func (d *Duration) UnmarshalJSON(b []byte) error
// func (n *IPNet) UnmarshalJSON(b []byte) error
}