30 lines
460 B
Go
30 lines
460 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestIsNewEmail(t *testing.T) {
|
|
data := []struct {
|
|
isnew bool
|
|
path string
|
|
}{
|
|
{
|
|
isnew: true,
|
|
path: "1377995543.50996_2.sagan.sf.xinu.tv:2,Rb",
|
|
},
|
|
{
|
|
isnew: false,
|
|
path: "1340520791.M843511P28536.sagan.sf.xinu.tv,S=1467,W=1503:2,RS",
|
|
},
|
|
}
|
|
|
|
for _, d := range data {
|
|
got := isNewEmail(d.path)
|
|
want := d.isnew
|
|
if got != want {
|
|
t.Error("Got", got, "want", want, "for", d.path)
|
|
}
|
|
}
|
|
}
|