(t *testing.T)
| 93 | } |
| 94 | |
| 95 | func TestXorCipherDecrypt(t *testing.T) { |
| 96 | for _, test := range xorTestData { |
| 97 | t.Run(test.description, func(t *testing.T) { |
| 98 | decrypted := Decrypt(byte(test.key), []byte(test.encrypted)) |
| 99 | |
| 100 | if !reflect.DeepEqual(string(decrypted), test.input) { |
| 101 | t.Logf("FAIL: %s", test.description) |
| 102 | t.Fatalf("Expecting %s, actual %s", test.input, string(decrypted)) |
| 103 | } |
| 104 | }) |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | func FuzzXOR(f *testing.F) { |
| 109 | f.Add([]byte("The Quick Brown Fox Jumps over the Lazy Dog."), byte('X')) |