@@ -9,8 +9,8 @@ func TestJoinVertical(t *testing.T) {
99 expected string
1010 }
1111 tests := []test {
12- {"pos0" , JoinVertical (0 , "A" , "BBBB" ), "A \n BBBB" },
13- {"pos1" , JoinVertical (1 , "A" , "BBBB" ), " A\n BBBB" },
12+ {"pos0" , JoinVertical (Left , "A" , "BBBB" ), "A \n BBBB" },
13+ {"pos1" , JoinVertical (Right , "A" , "BBBB" ), " A\n BBBB" },
1414 {"pos0.25" , JoinVertical (0.25 , "A" , "BBBB" ), " A \n BBBB" },
1515 }
1616
@@ -22,3 +22,24 @@ func TestJoinVertical(t *testing.T) {
2222 })
2323 }
2424}
25+
26+ func TestJoinHorizontal (t * testing.T ) {
27+ type test struct {
28+ name string
29+ result string
30+ expected string
31+ }
32+ tests := []test {
33+ {"pos0" , JoinHorizontal (Top , "A" , "B\n B\n B\n B" ), "AB\n B\n B\n B" },
34+ {"pos1" , JoinHorizontal (Bottom , "A" , "B\n B\n B\n B" ), " B\n B\n B\n AB" },
35+ {"pos0.25" , JoinHorizontal (0.25 , "A" , "B\n B\n B\n B" ), " B\n AB\n B\n B" },
36+ }
37+
38+ for _ , test := range tests {
39+ t .Run (test .name , func (t * testing.T ) {
40+ if test .result != test .expected {
41+ t .Errorf ("Got \n %s\n , expected \n %s\n " , test .result , test .expected )
42+ }
43+ })
44+ }
45+ }
0 commit comments