~reesmichael1/chantpointer

ref: fix_ci chantpointer/writer_test.go -rw-r--r-- 1.0 KiB View raw
a8ef912f — Michael Rees Only build on master 1 year, 6 months ago
                                                                                
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package main

import (
	"bytes"
	"testing"
)

func TestWriteVerses(t *testing.T) {
	buf := bytes.NewBuffer([]byte{})

	c := Chant{
		Title:    "Title",
		Subtitle: "Subtitle",
		Verses: []Verse{
			Verse{
				FirstPart:  "abc",
				SecondPart: "def",
			},

			Verse{
				FirstPart:  "123",
				SecondPart: "456",
			},
			Verse{
				FirstPart:  "ghi",
				SecondPart: "789",
				IsSecond:   true,
			},
		},
		PointSize: 12,
		ScorePath: "/tmp/chant.png",
	}

	expected := `\documentclass[12pt]{article}

\usepackage[margin=1in]{geometry}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{psalm}

\pagestyle{empty}

\begin{document}

\begin{center}
    {\Large \textbf{Title}}\\[12pt]
    \textit{Subtitle}\\[30pt]
    \includegraphics[width=\textwidth]{/tmp/chant.png}
\end{center}
\vspace{24pt}

\setlength\textamount{12cm}

\begin{center}
\begin{psalm}


\vs{}{abc}
{}{def}


\vs{}{123}
{}{456}


\vs{\second}{ghi}
{}{789}


\end{psalm}
\end{center}

\end{document}
`

	WriteTexForChant(buf, &c)
	equals(t, expected, string(buf.Bytes()))
}