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