X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=document%2Fdocument_test.go;h=6113fac00b739dc0632764ab6a87bb839cc24989;hb=4c0f648d876098fb8ba2297e47fb46718588596b;hp=8c3413ee41706d3d31bb3953e01dd97f815e3048;hpb=0f67afa98dad4de872810235afb541fe2dcfe5c4;p=epoint diff --git a/document/document_test.go b/document/document_test.go index 8c3413e..6113fac 100644 --- a/document/document_test.go +++ b/document/document_test.go @@ -95,7 +95,7 @@ func eqFields(f1, f2 []Field) bool { func TestClearSigned(t *testing.T) { for _, x := range testData { - c, err := DecodeClearSigned(x.D) + c, err := ParseClearSigned(x.D) if err != nil { t.Errorf("decoding %#v failed: %s\n", x.D, err) continue @@ -105,7 +105,7 @@ func TestClearSigned(t *testing.T) { } } for _, x := range testData { - d, err := EncodeClearSigned(x.C) + d, err := FormatClearSigned(x.C) if err != nil { t.Errorf("encoding %#v failed: %s\n", x.C, err) continue @@ -138,12 +138,13 @@ Drawer: 000000000000000000000000000000000000000A Beneficiary: 000000000000000000000000000000000000000B Amount: 1 Denomination: half euro -Issue-Date: 2011-11-13T12:20:35Z -Maturity-Date: 2011-12-27T09:18:46Z +Issuer: 000000000000000000000000000000000000000D +Authorized-By: 000000000000000000000000000000000000000C +Date: 2011-11-13T12:20:35Z +Maturity-Date: 2011-11-13T12:20:35Z +Expiry-Date: 2011-12-27T09:18:46Z Notes: some notes Nonce: 42 -Server: 000000000000000000000000000000000000000C -Drawee: 000000000000000000000000000000000000000D ` func TestDraft(t *testing.T) { @@ -152,7 +153,7 @@ func TestDraft(t *testing.T) { t.Errorf("ParseDraft failed: %s\n", err) return } - s, err := RenderDraft(d) + s, err := FormatDraft(d) if err != nil { t.Errorf("render %v draft failed: %s\n", d, err) } @@ -163,20 +164,21 @@ func TestDraft(t *testing.T) { const certBody = `Content-Type: text/plain.epoint.cert; charset=utf-8 -Holder: 000000000000000000000000000000000000000A +Holder: 0000000000000000000000000000000000000009 Serial: 13 Date: 2011-11-01T10:29:38Z Balance: 23 Denomination: half euro Issuer: 000000000000000000000000000000000000000B +Authorized-By: 000000000000000000000000000000000000000A Last-Debit-Serial: 0 Last-Credit-Serial: 12 Last-Cert: 000000000000000000000000000000000000000C Difference: 1 Draft: 000000000000000000000000000000000000000D Drawer: 000000000000000000000000000000000000000E -Drawer-Serial: 2 Drawer-Cert: 000000000000000000000000000000000000000F +Notes: - References: 000000000000000000000000000000000000000C 000000000000000000000000000000000000000F ` @@ -186,7 +188,7 @@ func TestCert(t *testing.T) { t.Errorf("ParseCert failed: %s\n", err) return } - s, err := RenderCert(c) + s, err := FormatCert(c) if err != nil { t.Errorf("render %v cert failed: %s\n", c, err) }