/usr/share/gocode/src/github.com/kballard/go-shellquote/quote_test.go is in golang-github-kballard-go-shellquote-dev 0.0~git20150810.0.d8ec1a6-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | package shellquote
import (
"testing"
)
func TestSimpleJoin(t *testing.T) {
for _, elem := range simpleJoinTest {
output := Join(elem.input...)
if output != elem.output {
t.Errorf("Input %q, got %q, expected %q", elem.input, output, elem.output)
}
}
}
var simpleJoinTest = []struct {
input []string
output string
}{
{[]string{"test"}, "test"},
{[]string{"hello goodbye"}, "'hello goodbye'"},
{[]string{"hello", "goodbye"}, "hello goodbye"},
{[]string{"don't you know the dewey decimal system?"}, "'don'\\''t you know the dewey decimal system?'"},
{[]string{"don't", "you", "know", "the", "dewey", "decimal", "system?"}, "don\\'t you know the dewey decimal system\\?"},
{[]string{"~user", "u~ser", " ~user", "!~user"}, "\\~user u~ser ' ~user' \\!~user"},
{[]string{"foo*", "M{ovies,usic}", "ab[cd]", "%3"}, "foo\\* M\\{ovies,usic} ab\\[cd] %3"},
{[]string{"one", "", "three"}, "one '' three"},
{[]string{"some(parentheses)"}, "some\\(parentheses\\)"},
{[]string{"$some_ot~her_)spe!cial_*_characters"}, "\\$some_ot~her_\\)spe\\!cial_\\*_characters"},
}
|