fancy docs and 100% coverage
This commit is contained in:
parent
d46826878c
commit
705af58a4d
2 changed files with 13 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
## null [](https://godoc.org/github.com/guregu/null) [](http://gocover.io/github.com/guregu/null)
|
||||
null is a library with opinions on how to deal with nullable SQL and JSON values
|
||||
|
||||
### String
|
||||
|
|
|
@ -46,6 +46,18 @@ func TestUnmarshalString(t *testing.T) {
|
|||
assertNull(t, null, "null json")
|
||||
}
|
||||
|
||||
func TestTextUnmarshalString(t *testing.T) {
|
||||
var str String
|
||||
err := str.UnmarshalText([]byte("test"))
|
||||
maybePanic(err)
|
||||
assert(t, str, "TextUnmarshal() string")
|
||||
|
||||
var null String
|
||||
err = null.UnmarshalText([]byte(""))
|
||||
maybePanic(err)
|
||||
assertNull(t, null, "TextUnmarshal() empty string")
|
||||
}
|
||||
|
||||
func TestMarshalString(t *testing.T) {
|
||||
str := StringFrom("test")
|
||||
data, err := json.Marshal(str)
|
||||
|
|
Loading…
Add table
Reference in a new issue