1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-26 23:06:25 -07:00
gochan/pkg/config/config_test.go
2023-06-09 10:15:41 -07:00

21 lines
397 B
Go

package config
import (
"encoding/json"
"strings"
"testing"
"github.com/stretchr/testify/assert"
)
func TestBadTypes(t *testing.T) {
var c GochanConfig
err := json.NewDecoder(strings.NewReader(badTypeJSON)).Decode(&c)
assert.Error(t, err)
}
func TestValidJSON(t *testing.T) {
var c GochanConfig
err := json.NewDecoder(strings.NewReader(validCfgJSON)).Decode(&c)
assert.Nil(t, err)
}