-
Notifications
You must be signed in to change notification settings - Fork 3
/
secconf_test.go
32 lines (28 loc) · 727 Bytes
/
secconf_test.go
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
31
32
// Copyright secconf. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE-secconf file.
package libconfd
import (
"bytes"
"testing"
)
var tSecconf_encodingTests = []struct {
in, out string
}{
{"secret", "secret"},
}
func TestSecconfEncoding(t *testing.T) {
for _, tt := range tSecconf_encodingTests {
encoded, err := secconfEncode([]byte(tt.in), bytes.NewBufferString(tSecconf_pubring))
if err != nil {
t.Errorf("%v", err)
}
decoded, err := secconfDecode(encoded, bytes.NewBufferString(tSecconf_secring))
if err != nil {
t.Errorf("%v", err)
}
if tt.out != string(decoded) {
t.Errorf("want %s, got %s", tt.out, decoded)
}
}
}