]> Sergey Matveev's repositories - btrtrc.git/blobdiff - tests/issue-798/main.go
Fix write error handling
[btrtrc.git] / tests / issue-798 / main.go
diff --git a/tests/issue-798/main.go b/tests/issue-798/main.go
new file mode 100644 (file)
index 0000000..3b9ad64
--- /dev/null
@@ -0,0 +1,18 @@
+package main
+
+import (
+       "fmt"
+       "github.com/anacrolix/torrent"
+)
+
+func main() {
+       config := torrent.NewDefaultClientConfig()
+       config.DataDir = "./output"
+       c, _ := torrent.NewClient(config)
+       defer c.Close()
+       t, _ := c.AddMagnet("magnet:?xt=urn:btih:99c82bb73505a3c0b453f9fa0e881d6e5a32a0c1&tr=https%3A%2F%2Ftorrent.ubuntu.com%2Fannounce&tr=https%3A%2F%2Fipv6.torrent.ubuntu.com%2Fannounce")
+       <-t.GotInfo()
+       fmt.Println("start downloading")
+       t.DownloadAll()
+       c.WaitAll()
+}
\ No newline at end of file