MCPcopy Index your code
hub / github.com/google/mangle / TestOutput

Function TestOutput

factstore/simplecolumn_test.go:44–84  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

42}
43
44func TestOutput(t *testing.T) {
45 m := testStore(t)
46 sc := SimpleColumn{true /* deterministic */}
47 var buf bytes.Buffer
48 if err := sc.WriteTo(m, &buf); err != nil {
49 t.Fatal(err)
50 }
51
52 want := `4
53baz 0 1
54foo 1 2
55bar 3 5
56qaz 3 2
57"\n/bar"
58/zzz
59/g
60/t
61/r
62[/abc]
63[/abc, /def]
643
652
661
674
685
69/h
70"\u{01f624}"
71/z
72/def
73/def
74[/def : 345, /abc : 123]
75{/def : 678, /abc : 456}
7610
7720
78b"\x80\x81"
79/zzz
80`
81 if diff := cmp.Diff(want, string(buf.Bytes())); diff != "" {
82 t.Errorf("WriteTo() unexpected difference -want +got %v", diff)
83 }
84}
85
86func TestRoundTrip(t *testing.T) {
87 m := testStore(t)

Callers

nothing calls this directly

Calls 2

WriteToMethod · 0.95
testStoreFunction · 0.85

Tested by

no test coverage detected