ratio-spoof/internal/ratiospoof/ratiospoof_test.go
ap-pauloafonso fa01ae1241 refactor
2021-02-09 20:32:32 -03:00

36 lines
848 B
Go

package ratiospoof
import (
"testing"
)
func assertAreEqual(t *testing.T, got, want interface{}) {
t.Helper()
if got != want {
t.Errorf("\ngot : %v\nwant: %v", got, want)
}
}
func TestClculateNextTotalSizeByte(T *testing.T) {
got := calculateNextTotalSizeByte(100*1024, 0, 512, 30, 87979879)
want := 3075072
assertAreEqual(T, got, want)
}
// func TestUrlEncodeInfoHash(T *testing.T) {
// b, _ := ioutil.ReadFile("")
// got := extractInfoHashURLEncoded(b, bencode.Decode(b))
// want := "%60N%7d%1f%8b%3a%9bT%d5%fc%ad%d1%27%ab5%02%1c%fb%03%b0"
// assertAreEqual(T, got, want)
// }
// func TestUrlEncodeInfoHash2(T *testing.T) {
// b, _ := ioutil.ReadFile("")
// got := extractInfoHashURLEncoded(b, bencode.Decode(b))
// want := "%02r%fd%fe%bf%fbt%d0%0f%cf%d9%8c%e0%a9%97%f8%08%9b%00%b2"
// assertAreEqual(T, got, want)
// }