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

Function TestXorCipherEncrypt

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

Source from the content-addressed store, hash-verified

81}
82
83func 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
95func TestXorCipherDecrypt(t *testing.T) {
96 for _, test := range xorTestData {

Callers

nothing calls this directly

Calls 1

EncryptFunction · 0.70

Tested by

no test coverage detected