Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Tohrusky authored Jul 17, 2024
2 parents 4c290f6 + 677d9c2 commit 56df313
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions module/torrent/torrent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,34 @@ func TestRepackTorrent(t *testing.T) {
t.Log(torrent)
assert.Equal(t, torrent.Comment, comment)
assert.Equal(t, torrent.Info.Source, infoSource)
assert.Equal(t, torrent.AnnounceList, TRACKER_LIST)
}

func TestTorrentFileList(t *testing.T) {

Check failure on line 77 in module/torrent/torrent_test.go

View workflow job for this annotation

GitHub Actions / unit-test (ubuntu-latest)

other declaration of TestTorrentFileList
torrentFilePath := testTorrentFolder

torrent, err := NewBitTorrentFilePath(torrentFilePath)
if err != nil {
t.Error(err)
return
}

fileList := torrent.GetFileList()
t.Log(fileList)
assert.Equal(t, len(fileList), 2)
assert.Equal(t, fileList[0].Path, []string{"cxk", "cxk.jpg"})

torrentFilePath = testTorrent
torrent, err = NewBitTorrentFilePath(torrentFilePath)
if err != nil {
t.Error(err)
return
}

fileList = torrent.GetFileList()
t.Log(fileList)
assert.Equal(t, len(fileList), 1)
assert.Equal(t, fileList[0].Path, []string{"lenna.jpg"})
}

func TestTorrentFileList(t *testing.T) {

Check failure on line 104 in module/torrent/torrent_test.go

View workflow job for this annotation

GitHub Actions / unit-test (ubuntu-latest)

TestTorrentFileList redeclared in this block
Expand Down

0 comments on commit 56df313

Please sign in to comment.