|
|
|
@@ -2,6 +2,7 @@ package rds |
|
|
|
|
|
|
|
import ( |
|
|
|
"math" |
|
|
|
"strings" |
|
|
|
"testing" |
|
|
|
) |
|
|
|
|
|
|
|
@@ -49,3 +50,18 @@ func TestEncoderReset(t *testing.T) { |
|
|
|
t.Fatalf("expected reset to replay initial sample: %v vs %v", sampleA, sampleB) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func TestNormalizePS(t *testing.T) { |
|
|
|
got := normalizePS("radiox") |
|
|
|
if got != "RADIOX " { |
|
|
|
t.Fatalf("unexpected PS: %q", got) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func TestNormalizeRT(t *testing.T) { |
|
|
|
long := strings.Repeat("a", 80) |
|
|
|
got := normalizeRT(long) |
|
|
|
if len(got) != 64 { |
|
|
|
t.Fatalf("unexpected RT length: %d", len(got)) |
|
|
|
} |
|
|
|
} |