1
0
mirror of https://github.com/ManyakRus/starter.git synced 2025-11-29 23:38:14 +02:00

сделал DateTimeFromString_rus()

This commit is contained in:
Nikitin Aleksandr
2025-04-23 13:56:09 +03:00
parent 3f37b541c8
commit 4b8ad70580
2 changed files with 48 additions and 0 deletions

View File

@@ -1444,3 +1444,31 @@ func TestStringFromFloat32_Dimension(t *testing.T) {
t.Errorf("Expected '1', but got %s", Otvet)
}
}
func TestDateTimeFromString_rus(t *testing.T) {
Text := "23.04.2025 10:05:01"
Otvet, err := DateTimeFromString_rus(Text)
if err != nil {
t.Errorf("Error: Expected nil, but got %v", err)
}
TextGood := "2025-04-23 10:05:01 +0000 UTC"
if Otvet.String() != TextGood {
t.Errorf("Expected '2025-04-23 10:05:01', but got %s", Otvet)
}
}
func TestDateFromString_rus(t *testing.T) {
Text := "23.04.2025 10:05:01"
Otvet, err := DateFromString_rus(Text)
if err != nil {
t.Errorf("Error: Expected nil, but got %v", err)
}
TextGood := "2025-04-23 00:00:00 +0000 UTC"
if Otvet.String() != TextGood {
t.Errorf("Expected '2025-04-23 00:00:00', but got %s", Otvet)
}
}