MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / TestXorCipherDecrypt

Function TestXorCipherDecrypt

cipher/xor/xor_test.go:95–106  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

93}
94
95func 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
108func FuzzXOR(f *testing.F) {
109 f.Add([]byte("The Quick Brown Fox Jumps over the Lazy Dog."), byte('X'))

Callers

nothing calls this directly

Calls 1

DecryptFunction · 0.70

Tested by

no test coverage detected