✅ 💯%
This commit is contained in:
parent
da3b524925
commit
f68aebdedb
2 changed files with 21 additions and 1 deletions
|
|
@ -55,7 +55,12 @@ func TestOverrideJson(t *testing.T) {
|
||||||
assert.Equal(t, "txt", c.Input.Ext)
|
assert.Equal(t, "txt", c.Input.Ext)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @todo test time
|
func TestTimeParse(t *testing.T) {
|
||||||
|
Overrides = map[string]string{"input.ext": "now"}
|
||||||
|
c, err := Load()
|
||||||
|
assert.ErrorContains(t, err, "incompatible types: TOML value has type time.Time; destination has type string")
|
||||||
|
assert.Equal(t, "txt", c.Input.Ext)
|
||||||
|
}
|
||||||
|
|
||||||
func TestStdoutMissing(t *testing.T) {
|
func TestStdoutMissing(t *testing.T) {
|
||||||
var oo Outputs = map[string]Output{}
|
var oo Outputs = map[string]Output{}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,21 @@ func (s *AppendTestSuite) TestSuccess() {
|
||||||
s.Assert().Contains(st, "\n@bar true")
|
s.Assert().Contains(st, "\n@bar true")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *AppendTestSuite) TestFailEntry() {
|
||||||
|
e := models.Entry{
|
||||||
|
Title: "Jimmy",
|
||||||
|
}
|
||||||
|
l := models.Log{
|
||||||
|
Name: "test",
|
||||||
|
Entries: []models.Entry{e},
|
||||||
|
}
|
||||||
|
err := Append(l)
|
||||||
|
s.Assert().NoError(err)
|
||||||
|
s.Require().FileExists(s.dir + "/test.log")
|
||||||
|
by, _ := os.ReadFile(s.dir + "/test.log")
|
||||||
|
s.Assert().Equal([]byte{}, by)
|
||||||
|
}
|
||||||
|
|
||||||
func (s *AppendTestSuite) TestDotFolder() {
|
func (s *AppendTestSuite) TestDotFolder() {
|
||||||
config.Overrides["input.dotFolder"] = "true"
|
config.Overrides["input.dotFolder"] = "true"
|
||||||
e := models.Entry{
|
e := models.Entry{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue