elliptic_test.go 484 B

123456789101112131415161718192021222324252627
  1. // SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
  2. // SPDX-License-Identifier: MIT
  3. package elliptic
  4. import "testing"
  5. func TestString(t *testing.T) {
  6. tests := []struct {
  7. in Curve
  8. out string
  9. }{
  10. {X25519, "X25519"},
  11. {P256, "P-256"},
  12. {P384, "P-384"},
  13. {0, "0x0"},
  14. }
  15. for _, tt := range tests {
  16. tt := tt
  17. t.Run(tt.out, func(t *testing.T) {
  18. if tt.in.String() != tt.out {
  19. t.Fatalf("Expected: %s, got: %s", tt.out, tt.in.String())
  20. }
  21. })
  22. }
  23. }