-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Philipp Galichkin
committed
Aug 19, 2024
1 parent
3f0b44b
commit a2f2d6e
Showing
3 changed files
with
89 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package duration | ||
|
||
import ( | ||
"reflect" | ||
"testing" | ||
"time" | ||
) | ||
|
||
func TestDateTimeToDate(t *testing.T) { | ||
type args struct { | ||
date string | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
want time.Time | ||
}{ | ||
{"TestDateTimeToDate", | ||
args{"14 Apr 2020 10:00"}, | ||
time.Date(2020, 4, 14, 0, 0, 0, 0, time.UTC), | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := DateTimeToDate(tt.args.date); !reflect.DeepEqual(got, tt.want) { | ||
t.Errorf("DateTimeToDate() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters