2024-01-07 20:04:57 +08:00
|
|
|
package carbon
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2024-01-12 10:57:10 +08:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2024-01-07 20:04:57 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestCarbon_SetDefault(t *testing.T) {
|
|
|
|
SetDefault(Default{
|
2024-01-12 10:57:10 +08:00
|
|
|
Layout: DateTimeLayout,
|
|
|
|
Timezone: Local,
|
|
|
|
Locale: "en",
|
|
|
|
WeekStartsAt: Sunday,
|
2024-01-07 20:04:57 +08:00
|
|
|
})
|
|
|
|
assert.Equal(t, DateTimeLayout, defaultLayout)
|
|
|
|
assert.Equal(t, Local, defaultTimezone)
|
|
|
|
assert.Equal(t, "en", defaultLocale)
|
2024-01-12 10:57:10 +08:00
|
|
|
assert.Equal(t, "Sunday", defaultWeekStartsAt)
|
2024-01-07 20:04:57 +08:00
|
|
|
}
|