(t *testing.T)
| 932 | } |
| 933 | |
| 934 | func TestEncryptComments(t *testing.T) { |
| 935 | tree := Tree{ |
| 936 | Branches: TreeBranches{ |
| 937 | TreeBranch{ |
| 938 | TreeItem{ |
| 939 | Key: Comment{Value: "foo"}, |
| 940 | Value: nil, |
| 941 | }, |
| 942 | TreeItem{ |
| 943 | Key: "list", |
| 944 | Value: []interface{}{ |
| 945 | "1", |
| 946 | Comment{Value: "bar"}, |
| 947 | "2", |
| 948 | }, |
| 949 | }, |
| 950 | }, |
| 951 | }, |
| 952 | Metadata: Metadata{ |
| 953 | UnencryptedSuffix: DefaultUnencryptedSuffix, |
| 954 | }, |
| 955 | } |
| 956 | tree.Encrypt(bytes.Repeat([]byte{'f'}, 32), reverseCipher{}) |
| 957 | assert.Equal(t, "oof", tree.Branches[0][0].Key.(Comment).Value) |
| 958 | assert.Equal(t, "rab", tree.Branches[0][1].Value.([]interface{})[1]) |
| 959 | } |
| 960 | |
| 961 | func TestDecryptComments(t *testing.T) { |
| 962 | tree := Tree{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…