MCPcopy
hub / github.com/direnv/direnv / TestFTJsons

Function TestFTJsons

internal/cmd/file_times_test.go:22–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

20}
21
22func TestFTJsons(t *testing.T) {
23 ft := FileTime{"something.txt", time.Now().Unix(), true}
24 marshalled, err := json.Marshal(ft)
25 if err != nil {
26 t.Error("FileTime failed to marshal:", err)
27 }
28 if bytes.NewBuffer(marshalled).String() == "{}" {
29 t.Error(ft, "marshals as empty object")
30 }
31
32}
33
34func TestRoundTrip(t *testing.T) {
35 watches := NewFileTimes()

Callers

nothing calls this directly

Calls 3

MarshalMethod · 0.80
ErrorMethod · 0.80
StringMethod · 0.80

Tested by

no test coverage detected