mirror of
https://github.com/zrepl/zrepl.git
synced 2025-08-24 21:15:30 +02:00
move implementation to internal/
directory (#828)
This commit is contained in:
committed by
GitHub
parent
b9b9ad10cf
commit
908807bd59
33
internal/platformtest/platformtest_parser_test.go
Normal file
33
internal/platformtest/platformtest_parser_test.go
Normal 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)
|
||||
|
||||
}
|
Reference in New Issue
Block a user