add platformtest: infrastructure for ZFS compatiblity testing

This commit is contained in:
Christian Schwarz
2019-08-20 17:04:13 +02:00
parent 07956c2299
commit a6497b2c6e
15 changed files with 689 additions and 3 deletions
+33
View File
@@ -0,0 +1,33 @@
package platformtest
import (
"bufio"
"strings"
"testing"
"github.com/stretchr/testify/assert"
)
func TestSplitQuotedWords(t *testing.T) {
s := bufio.NewScanner(strings.NewReader(`
foo "bar baz" blah "foo \"with single escape" "blah baz" "\"foo" "foo\""
`))
s.Split(splitQuotedWords)
var words []string
for s.Scan() {
words = append(words, s.Text())
}
assert.Equal(
t,
[]string{
"foo",
"bar baz",
"blah",
"foo \"with single escape",
"blah baz",
"\"foo",
"foo\"",
},
words)
}