mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-26 23:06:25 -07:00
21 lines
397 B
Go
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)
|
|
}
|