github.com/olivere/camlistore@v0.0.0-20140121221811-1b7ac2da0199/third_party/code.google.com/p/go.crypto/ssh/common_test.go (about) 1 // Copyright 2011 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package ssh 6 7 import ( 8 "testing" 9 ) 10 11 func TestSafeString(t *testing.T) { 12 strings := map[string]string{ 13 "\x20\x0d\x0a": "\x20\x0d\x0a", 14 "flibble": "flibble", 15 "new\x20line": "new\x20line", 16 "123456\x07789": "123456 789", 17 "\t\t\x10\r\n": "\t\t \r\n", 18 } 19 20 for s, expected := range strings { 21 actual := safeString(s) 22 if expected != actual { 23 t.Errorf("expected: %v, actual: %v", []byte(expected), []byte(actual)) 24 } 25 } 26 }