💯%

This commit is contained in:
Dan Jones 2024-03-07 21:50:51 -06:00
commit f68aebdedb
2 changed files with 21 additions and 1 deletions

View file

@ -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{}

View file

@ -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{