-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbreaklines_test.go
91 lines (87 loc) · 2.76 KB
/
breaklines_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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
package main
import "testing"
func TestLineBreaking(t *testing.T) {
var tests = []struct {
input string
output string
}{
{
`\\name[Domestic scent](…Properly……I want to take a bath……
today…Let's go home.……)`,
`\\name[Domestic scent](…Properly……I want to take a bath……
today…Let's go home.……)`,
},
{
`"Money %s\\\\G I got!"`,
`"Money %s\\\\G I got!"`,
},
{
`☆【A whip】Bamboo that manipulates
thunder。 Get Lightning Lv 20。
attack:+80 Mausoleum:+80 (Blow)(Overall)(Thunder)(Stan)`,
`☆【A whip】Bamboo that manipulates
thunder。 Get Lightning Lv 20。
attack:+80 Mausoleum:+80 (Blow)(Overall)(
Thunder)(Stan)`,
},
{
`【dagger】It is rusty and its sharpness
【dagger】It is rusty and its sharpness is dull but it will not get stuck。
attack:+4 (Slashing)(Speed↑)`,
`【dagger】It is rusty and its sharpness
【dagger】It is rusty and its sharpness is
dull but it will not get stuck。
attack:+4 (Slashing)(Speed↑)`,
},
{
`【sword】If you equip it, you will get an assault lance song Lv 7。
attack:+56 (Slashing)(hit↑)`,
`【sword】If you equip it, you will get an
assault lance song Lv 7。
attack:+56 (Slashing)(hit↑)`,
},
{
`<The contents will be updated even if you see the event by recollection>`,
`<The contents will be updated even if you
see the event by recollection>`,
},
{
`After viewing the event the content is updated,
Reset by sleeping in bed。
<The contents will be updated even if you see the event by recollection\>`,
`After viewing the event the content is updated,
Reset by sleeping in bed。
<The contents will be updated even if you
see the event by recollection\>`,
},
{
`During 5 turns, the user is given flames・ice・Give the attribute of lightning`,
`During 5 turns, the user is given flames・ice・
Give the attribute of lightning`,
},
{
`「For example『Element of fire』When receiving protection of,
Attack of fire attribute will cause additional attribute attack。
and,『Element of regeneration』If you receive protection from,
It will be natural and physical strength will recover during battle」
`,
`「For example『Element of fire』When
receiving protection of,
Attack of fire attribute will cause
additional attribute attack。
and,『Element of regeneration』If you
receive protection from,
It will be natural and physical strength
will recover during battle」
`,
},
}
lineLength = 42
lineTolerance = 5
for _, pair := range tests {
r := breakLines(pair.input)
if r != pair.output {
t.Errorf("For input:\n%q\nexpected:\n%q\ngot:\n%q\n", pair.input, pair.output, r)
}
}
}