fstests: add TestFsPutChunked

This commit is contained in:
Fabian Möller 2018-10-09 09:42:45 +02:00 committed by Nick Craig-Wood
parent 84289d1d69
commit 57273d364b
2 changed files with 126 additions and 0 deletions

View file

@ -4,6 +4,7 @@ package fs
import (
"fmt"
"math"
"sort"
"strconv"
"strings"
@ -130,3 +131,15 @@ func (x *SizeSuffix) Scan(s fmt.ScanState, ch rune) error {
}
return x.Set(string(token))
}
// SizeSuffixList is a sclice SizeSuffix values
type SizeSuffixList []SizeSuffix
func (l SizeSuffixList) Len() int { return len(l) }
func (l SizeSuffixList) Swap(i, j int) { l[i], l[j] = l[j], l[i] }
func (l SizeSuffixList) Less(i, j int) bool { return l[i] < l[j] }
// Sort sorts the list
func (l SizeSuffixList) Sort() {
sort.Sort(l)
}