update tests for mst

master
Bel LaPointe 2022-03-23 07:13:55 -06:00
parent 65178b8bdf
commit 20770ff5e6
2 changed files with 13 additions and 6 deletions

View File

@ -1,5 +1,9 @@
package pttodo
/*
action is something like 'send an email on trigger' but is not impl or use
*/
import (
"errors"
"local/sandbox/contact/contact"
@ -21,7 +25,7 @@ func (action Action) CB() (func() error, error) {
u, _ := url.Parse(action.String())
switch u.Scheme {
case "email":
return action.email
return action.email, nil
}
if actionEmailPattern.MatchString(action.String()) {
return action.email, nil

View File

@ -1,6 +1,7 @@
package pttodo
import (
"bytes"
"encoding/json"
"fmt"
"strconv"
@ -163,17 +164,19 @@ func TestRootMarshalYAMLWriteTS(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if strings.TrimSpace(string(got)) != strings.TrimSpace(`
got = bytes.TrimSpace(got)
want := strings.TrimSpace(`
todo:
- todo
scheduled:
- todo: sched
schedule: "2099-01-01"
ts: Wed Dec 31 19:00:02 EST 1969
ts: Wed Dec 31 17:00:02 MST 1969
done:
- todo: done
ts: Wed Dec 31 19:00:03 EST 1969
`) {
t.Fatal(string(got))
ts: Wed Dec 31 17:00:03 MST 1969
`)
if string(got) != want {
t.Fatalf("want\n\t%q, got\n\t%q", want, string(got))
}
}