This commit is contained in:
Pavel Flegr 2026-04-08 17:53:30 +02:00
commit ef105e1cac
22 changed files with 3001 additions and 0 deletions

View file

@ -0,0 +1,31 @@
package platform
import "testing"
func TestParseCZK(t *testing.T) {
tests := []struct {
input string
want int64
}{
{input: "100", want: 10000},
{input: "100.50", want: 10050},
{input: "100,5", want: 10050},
}
for _, tt := range tests {
got, err := ParseCZK(tt.input)
if err != nil {
t.Fatalf("ParseCZK(%q) returned error: %v", tt.input, err)
}
if got != tt.want {
t.Fatalf("ParseCZK(%q) = %d, want %d", tt.input, got, tt.want)
}
}
}
func TestFormatCZK(t *testing.T) {
got := FormatCZK(1234567)
if got != "12 345,67 CZK" {
t.Fatalf("FormatCZK() = %q", got)
}
}