projects
/
epoint
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
document renames and simplification
[epoint]
/
document
/
document_test.go
diff --git
a/document/document_test.go
b/document/document_test.go
index
8c3413e
..
6113fac
100644
(file)
--- 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 {
func TestClearSigned(t *testing.T) {
for _, x := range testData {
- c, err :=
Decod
eClearSigned(x.D)
+ c, err :=
Pars
eClearSigned(x.D)
if err != nil {
t.Errorf("decoding %#v failed: %s\n", x.D, err)
continue
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 {
}
}
for _, x := range testData {
- d, err :=
Encode
ClearSigned(x.C)
+ d, err :=
Format
ClearSigned(x.C)
if err != nil {
t.Errorf("encoding %#v failed: %s\n", x.C, err)
continue
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
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
Notes: some notes
Nonce: 42
-Server: 000000000000000000000000000000000000000C
-Drawee: 000000000000000000000000000000000000000D
`
func TestDraft(t *testing.T) {
`
func TestDraft(t *testing.T) {
@@
-152,7
+153,7
@@
func TestDraft(t *testing.T) {
t.Errorf("ParseDraft failed: %s\n", err)
return
}
t.Errorf("ParseDraft failed: %s\n", err)
return
}
- s, err :=
Render
Draft(d)
+ s, err :=
Format
Draft(d)
if err != nil {
t.Errorf("render %v draft failed: %s\n", d, err)
}
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
const certBody = `Content-Type: text/plain.epoint.cert; charset=utf-8
-Holder: 000000000000000000000000000000000000000
A
+Holder: 000000000000000000000000000000000000000
9
Serial: 13
Date: 2011-11-01T10:29:38Z
Balance: 23
Denomination: half euro
Issuer: 000000000000000000000000000000000000000B
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
Last-Debit-Serial: 0
Last-Credit-Serial: 12
Last-Cert: 000000000000000000000000000000000000000C
Difference: 1
Draft: 000000000000000000000000000000000000000D
Drawer: 000000000000000000000000000000000000000E
-Drawer-Serial: 2
Drawer-Cert: 000000000000000000000000000000000000000F
Drawer-Cert: 000000000000000000000000000000000000000F
+Notes: -
References: 000000000000000000000000000000000000000C 000000000000000000000000000000000000000F
`
References: 000000000000000000000000000000000000000C 000000000000000000000000000000000000000F
`
@@
-186,7
+188,7
@@
func TestCert(t *testing.T) {
t.Errorf("ParseCert failed: %s\n", err)
return
}
t.Errorf("ParseCert failed: %s\n", err)
return
}
- s, err :=
Render
Cert(c)
+ s, err :=
Format
Cert(c)
if err != nil {
t.Errorf("render %v cert failed: %s\n", c, err)
}
if err != nil {
t.Errorf("render %v cert failed: %s\n", c, err)
}