aboutsummaryrefslogtreecommitdiff
path: root/environment_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2021-12-19 14:40:18 +0700
committerShulhan <ms@kilabit.info>2021-12-19 14:40:18 +0700
commit7ee3e4ea4658e85a40540212b95206b09686feb7 (patch)
treebabe6a3568f6ead05799e0af31c6d5f6851cfa0b /environment_test.go
parent7713203c6bd41053599732869a70467a168e4e55 (diff)
downloadrescached-7ee3e4ea4658e85a40540212b95206b09686feb7.tar.xz
all: refactoring Server initialization
Previously, we initialize the rescached Server by passing the path to configuration file and initialize the environment inside the server. This commit changes it to pass the instance of Environment. The idea is to allow creating and running rescached Server without creating configuration file first.
Diffstat (limited to 'environment_test.go')
-rw-r--r--environment_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/environment_test.go b/environment_test.go
index 985df1d..c9278a7 100644
--- a/environment_test.go
+++ b/environment_test.go
@@ -16,11 +16,11 @@ func TestEnvironment(t *testing.T) {
cases := []struct {
desc string
content string
- exp *environment
+ exp *Environment
expError string
}{{
desc: "With empty content",
- exp: &environment{},
+ exp: &Environment{},
}, {
desc: "With multiple parents",
content: `[dns "server"]
@@ -28,7 +28,7 @@ listen = 127.0.0.1:53
parent = udp://35.240.172.103
parent = https://kilabit.info/dns-query
`,
- exp: &environment{
+ exp: &Environment{
ServerOptions: dns.ServerOptions{
ListenAddress: "127.0.0.1:53",
NameServers: []string{
@@ -42,7 +42,7 @@ parent = https://kilabit.info/dns-query
for _, c := range cases {
t.Log(c.desc)
- got := &environment{
+ got := &Environment{
ServerOptions: dns.ServerOptions{},
}