(t *testing.T)
| 81 | } |
| 82 | |
| 83 | func TestXorCipherEncrypt(t *testing.T) { |
| 84 | for _, test := range xorTestData { |
| 85 | t.Run(test.description, func(t *testing.T) { |
| 86 | encrypted := Encrypt(byte(test.key), []byte(test.input)) |
| 87 | if !reflect.DeepEqual(string(encrypted), test.encrypted) { |
| 88 | t.Logf("FAIL: %s", test.description) |
| 89 | t.Fatalf("Expecting %s, actual %s", test.encrypted, string(encrypted)) |
| 90 | } |
| 91 | }) |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | func TestXorCipherDecrypt(t *testing.T) { |
| 96 | for _, test := range xorTestData { |