rss and rss item and encode
Former-commit-id: 333b5635cc0eb22964403cc78f660e02a830f077
This commit is contained in:
24
config/encode_test.go
Normal file
24
config/encode_test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestEncodeDecode(t *testing.T) {
|
||||
c := time.Now()
|
||||
d := c.Add(0)
|
||||
|
||||
b, err := Encode(c)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := Decode(b, &c); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if c.Sub(d) > time.Millisecond*5 {
|
||||
t.Fatalf("%v => %v", d, c)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user