2021-11-22 15:17:10 +03:00
|
|
|
package lipgloss
|
|
|
|
|
|
|
|
import "testing"
|
|
|
|
|
|
|
|
func TestJoinVertical(t *testing.T) {
|
|
|
|
type test struct {
|
2022-06-01 16:38:18 +03:00
|
|
|
name string
|
2021-11-22 15:17:10 +03:00
|
|
|
result string
|
|
|
|
expected string
|
|
|
|
}
|
|
|
|
tests := []test{
|
2023-03-12 13:04:42 +03:00
|
|
|
{"pos0", JoinVertical(0, "A", "BBBB"), "A \nBBBB"},
|
2022-06-01 16:38:18 +03:00
|
|
|
{"pos1", JoinVertical(1, "A", "BBBB"), " A\nBBBB"},
|
|
|
|
{"pos0.25", JoinVertical(0.25, "A", "BBBB"), " A \nBBBB"},
|
2021-11-22 15:17:10 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
for _, test := range tests {
|
2022-06-01 16:38:18 +03:00
|
|
|
t.Run(test.name, func(t *testing.T) {
|
|
|
|
if test.result != test.expected {
|
|
|
|
t.Errorf("Got \n%s\n, expected \n%s\n", test.result, test.expected)
|
|
|
|
}
|
|
|
|
})
|
2021-11-22 15:17:10 +03:00
|
|
|
}
|
|
|
|
}
|