FFly3CLI/config/config_test.go

30 lines
449 B
Go

package config
import (
"os"
"testing"
)
func TestNew(t *testing.T) {
was := append([]string{}, os.Args...)
defer func() {
os.Args = was
}()
os.Args = []string{
"nothing",
"-addr", "str",
"-u", "str",
"-p", "str",
"-description", "str",
"-category", "str",
"-to", "str",
"-from", "str",
"-type", "str",
"-cost", "1.5",
"-date", "2019-03-04",
}
if err := New(); err != nil {
t.Fatalf("error on new: %v", err)
}
}