change detail to details, more ideas for howto mobile and safe

This commit is contained in:
Bel LaPointe
2021-12-31 21:17:37 -05:00
parent 141a374441
commit cb0f268454
4 changed files with 26 additions and 14 deletions

View File

@@ -13,7 +13,7 @@ func TestJSONTodo(t *testing.T) {
todo := func() Todo {
return Todo{
Todo: "todo",
Detail: "detail",
Details: "detail",
TS: TS(1),
Schedule: Schedule("schedule"),
}
@@ -68,7 +68,7 @@ todo: my full task here
if err := yaml.Unmarshal([]byte(`
todo:
todo: the todo part of my task
detail: whatever
details: whatever
schedule: "* * * * *"
`), &littleRoot); err != nil {
t.Fatal(err)
@@ -76,7 +76,7 @@ todo:
if littleRoot.Todo.Todo != "the todo part of my task" {
t.Fatal(littleRoot)
}
if littleRoot.Todo.Detail != "whatever" {
if littleRoot.Todo.Details != "whatever" {
t.Fatal(littleRoot)
}
if littleRoot.Todo.Schedule != "* * * * *" {
@@ -114,14 +114,14 @@ func TestMarshalTodo(t *testing.T) {
t.Run(`struct should return struct`, func(t *testing.T) {
var todo Todo
if b, err := yaml.Marshal(Todo{Todo: "a", Detail: "b"}); err != nil {
if b, err := yaml.Marshal(Todo{Todo: "a", Details: "b"}); err != nil {
t.Fatal(err)
} else if err := yaml.Unmarshal(b, &todo); err != nil {
t.Fatal(err)
} else if todo.Todo != "a" {
t.Fatal(todo.Todo)
} else if todo.Detail != "b" {
t.Fatal(todo.Detail)
} else if todo.Details != "b" {
t.Fatal(todo.Details)
}
})
}