lab 3 done
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestTimestampFixedMicroseconds(t *testing.T) {
|
||||
timestamp := Timestamp(time.Date(2026, 1, 2, 3, 4, 5, 123400000, time.UTC))
|
||||
encoded, err := json.Marshal(timestamp)
|
||||
if err != nil || string(encoded) != `"2026-01-02T03:04:05.123400Z"` {
|
||||
t.Fatalf("timestamp=%s err=%v", encoded, err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user