~mendelmaleh/pfin

ref: parallel pfin/parser/util/date_test.go -rw-r--r-- 352 bytes
95ffe938Mendel E Parallelize directory parsing 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package util

import (
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
)

func TestDateISO(t *testing.T) {
	d := DateISO{}

	if err := d.UnmarshalText([]byte("2022-04-26")); err != nil {
		t.Errorf("error unmarshaling text: %s", err)
	}

	assert := assert.New(t)
	assert.Equal(time.Date(2022, time.April, 26, 0, 0, 0, 0, time.UTC), d.Time)
}