(t *testing.T)
| 66 | } |
| 67 | |
| 68 | func TestEncryptWithPublicKey(t *testing.T) { |
| 69 | // Valid 32-byte public key in base64 |
| 70 | validKey := "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNERUY=" |
| 71 | plaintext := "my-secret-value" |
| 72 | |
| 73 | encrypted, err := encryptWithPublicKey(validKey, plaintext) |
| 74 | if err != nil { |
| 75 | t.Fatalf("encryptWithPublicKey() error = %v", err) |
| 76 | } |
| 77 | |
| 78 | if encrypted == "" { |
| 79 | t.Error("encryptWithPublicKey() returned empty string") |
| 80 | } |
| 81 | |
| 82 | // The encrypted value should be different from the plaintext |
| 83 | if encrypted == plaintext { |
| 84 | t.Error("encrypted value should differ from plaintext") |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | func TestEncryptWithPublicKeyInvalidKey(t *testing.T) { |
| 89 | tests := []struct { |
nothing calls this directly
no test coverage detected