代码拉取完成,页面将自动刷新
git lfs dedup for file system level deduplication.
package tools
import (
"bytes"
"io"
"io/ioutil"
"os"
"testing"
"github.com/stretchr/testify/assert"
)
func TestCopyWithCallback(t *testing.T) {
buf := bytes.NewBufferString("BOOYA")
called := 0
calledWritten := make([]int64, 0, 2)
n, err := CopyWithCallback(ioutil.Discard, buf, 5, func(total int64, written int64, current int) error {
called += 1
calledWritten = append(calledWritten, written)
assert.Equal(t, 5, int(total))
return nil
})
assert.Nil(t, err)
assert.Equal(t, 5, int(n))
assert.Equal(t, 1, called)
assert.Len(t, calledWritten, 1)
assert.Equal(t, 5, int(calledWritten[0]))
}
func TestMethodExists(t *testing.T) {
// testing following methods exist in all platform.
_, _ = CheckCloneFileSupported(os.TempDir())
_, _ = CloneFile(io.Writer(nil), io.Reader(nil))
_, _ = CloneFileByPath("", "")
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。