aboutsummaryrefslogtreecommitdiff
path: root/plugin/torrent/setup_test.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2020-07-28 16:39:35 +0200
committerGravatar Miek Gieben <miek@miek.nl> 2020-07-28 16:39:35 +0200
commitf21fa187383b7d1ba1c18ee617cb70e810cf1485 (patch)
treee7d9271855e48cc6973b8e3b5c3e8fd4f325c246 /plugin/torrent/setup_test.go
parent37e6038788beb5ee1154e71bb3fc07c3e708fa5d (diff)
downloadcoredns-torrent.tar.gz
coredns-torrent.tar.zst
coredns-torrent.zip
Move to new torrent libtorrent
Signed-off-by: Miek Gieben <miek@miek.nl>
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)
- }
- }
-}