aboutsummaryrefslogtreecommitdiff
path: root/plugin/torrent/setup_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/torrent/setup_test.go')
-rw-r--r--plugin/torrent/setup_test.go53
1 files changed, 0 insertions, 53 deletions
diff --git a/plugin/torrent/setup_test.go b/plugin/torrent/setup_test.go
deleted file mode 100644
index ae2f7baf5..000000000
--- a/plugin/torrent/setup_test.go
+++ /dev/null
@@ -1,53 +0,0 @@
-package torrent
-
-import (
- "testing"
-
- "github.com/caddyserver/caddy"
-)
-
-func TestParse(t *testing.T) {
- tests := []struct {
- input string
- shouldErr bool
- exp *Torrent
- }{
- {`torrent testdata/db.miek.nl {
- dht
- }`,
- false,
- &Torrent{dbfile: "testdata/db.miek.nl", dht: true},
- },
- {`torrent testdata/db.miek.nl`,
- false,
- &Torrent{dbfile: "testdata/db.miek.nl"},
- },
- // errors
- {`torrent db.example.org {
- bla
- }`,
- true,
- nil,
- },
- }
- for i, tc := range tests {
- c := caddy.NewTestController("dns", tc.input)
- tor, err := parse(c)
-
- if err == nil && tc.shouldErr {
- t.Fatalf("Test %d expected errors, but got no error", i)
- }
- if err != nil && !tc.shouldErr {
- t.Fatalf("Test %d expected no errors, but got '%v'", i, err)
- }
- if tc.shouldErr {
- continue
- }
- if x := tor.dbfile; x != tc.exp.dbfile {
- t.Errorf("Test %d expected %s as dbfile, got %s", i, tc.exp.dbfile, x)
- }
- if x := tor.dth; x != tc.exp.dth {
- t.Errorf("Test %d expected %T as seed, got %T", i, tc.exp.dth, x)
- }
- }
-}