-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathgedcomer_test.go
41 lines (29 loc) · 978 Bytes
/
gedcomer_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package gedcom_test
import (
"testing"
"github.com/elliotchance/gedcom/v39"
"github.com/elliotchance/tf"
)
func TestGEDCOMLine(t *testing.T) {
GEDCOMLine := tf.Function(t, gedcom.GEDCOMLine)
nameNode := gedcom.NewNameNode("Joe /Bloggs/",
gedcom.NewDateNode("3 Sep 1943"),
)
GEDCOMLine(nil, 0).Returns("")
GEDCOMLine(nameNode, gedcom.NoIndent).Returns("NAME Joe /Bloggs/")
GEDCOMLine(nameNode, 0).Returns("0 NAME Joe /Bloggs/")
GEDCOMLine(nameNode, 5).Returns("5 NAME Joe /Bloggs/")
}
func TestGEDCOMString(t *testing.T) {
GEDCOMString := tf.Function(t, gedcom.GEDCOMString)
nameNode := gedcom.NewNameNode("Joe /Bloggs/",
gedcom.NewDateNode("3 Sep 1943"),
)
GEDCOMString(nil, 0).Returns("")
GEDCOMString(nameNode, gedcom.NoIndent).
Returns("NAME Joe /Bloggs/\nDATE 3 Sep 1943\n")
GEDCOMString(nameNode, 0).
Returns("0 NAME Joe /Bloggs/\n1 DATE 3 Sep 1943\n")
GEDCOMString(nameNode, 5).
Returns("5 NAME Joe /Bloggs/\n6 DATE 3 Sep 1943\n")
}