update tests for mst
parent
65178b8bdf
commit
20770ff5e6
|
|
@ -1,5 +1,9 @@
|
||||||
package pttodo
|
package pttodo
|
||||||
|
|
||||||
|
/*
|
||||||
|
action is something like 'send an email on trigger' but is not impl or use
|
||||||
|
*/
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"local/sandbox/contact/contact"
|
"local/sandbox/contact/contact"
|
||||||
|
|
@ -21,7 +25,7 @@ func (action Action) CB() (func() error, error) {
|
||||||
u, _ := url.Parse(action.String())
|
u, _ := url.Parse(action.String())
|
||||||
switch u.Scheme {
|
switch u.Scheme {
|
||||||
case "email":
|
case "email":
|
||||||
return action.email
|
return action.email, nil
|
||||||
}
|
}
|
||||||
if actionEmailPattern.MatchString(action.String()) {
|
if actionEmailPattern.MatchString(action.String()) {
|
||||||
return action.email, nil
|
return action.email, nil
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package pttodo
|
package pttodo
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
@ -163,17 +164,19 @@ func TestRootMarshalYAMLWriteTS(t *testing.T) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
if strings.TrimSpace(string(got)) != strings.TrimSpace(`
|
got = bytes.TrimSpace(got)
|
||||||
|
want := strings.TrimSpace(`
|
||||||
todo:
|
todo:
|
||||||
- todo
|
- todo
|
||||||
scheduled:
|
scheduled:
|
||||||
- todo: sched
|
- todo: sched
|
||||||
schedule: "2099-01-01"
|
schedule: "2099-01-01"
|
||||||
ts: Wed Dec 31 19:00:02 EST 1969
|
ts: Wed Dec 31 17:00:02 MST 1969
|
||||||
done:
|
done:
|
||||||
- todo: done
|
- todo: done
|
||||||
ts: Wed Dec 31 19:00:03 EST 1969
|
ts: Wed Dec 31 17:00:03 MST 1969
|
||||||
`) {
|
`)
|
||||||
t.Fatal(string(got))
|
if string(got) != want {
|
||||||
|
t.Fatalf("want\n\t%q, got\n\t%q", want, string(got))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue