fix: time repr wrapper (#2255)
This commit is contained in:
@@ -3,6 +3,7 @@ package sqlx
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
@@ -138,3 +139,14 @@ func TestFormat(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestWriteValue(t *testing.T) {
|
||||
var buf strings.Builder
|
||||
tm := time.Now()
|
||||
writeValue(&buf, &tm)
|
||||
assert.Equal(t, "'"+tm.String()+"'", buf.String())
|
||||
|
||||
buf.Reset()
|
||||
writeValue(&buf, tm)
|
||||
assert.Equal(t, "'"+tm.String()+"'", buf.String())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user