mirror of
https://github.com/ManyakRus/starter.git
synced 2025-11-26 23:10:42 +02:00
27 lines
587 B
Go
27 lines
587 B
Go
package postgres_func
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestStringSQLTime(t *testing.T) {
|
|
|
|
var loc = time.Local
|
|
time1 := time.Date(2023, 1, 1, 0, 0, 0, 0, loc)
|
|
Otvet := StringSQLTime(time1)
|
|
if Otvet != "'2023-01-01T00:00:00+03:00'" {
|
|
t.Error("postgres_func_test.TestStringSQLTime() error")
|
|
}
|
|
|
|
}
|
|
|
|
func TestStringSQLTime_WithoutTimeZone(t *testing.T) {
|
|
var loc = time.Local
|
|
time1 := time.Date(2023, 1, 1, 0, 0, 0, 0, loc)
|
|
Otvet := StringSQLTime_WithoutTimeZone(time1)
|
|
if Otvet != "'2023-01-01T00:00:00+00:00'" {
|
|
t.Error("postgres_func_test.TestStringSQLTime() error")
|
|
}
|
|
}
|