Skip to content

Commit

Permalink
test: add test for JoinHorizontal
Browse files Browse the repository at this point in the history
  • Loading branch information
aditipatelpro committed Aug 7, 2024
1 parent 69956d1 commit b1d066a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions join_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,24 @@ func TestJoinVertical(t *testing.T) {
})
}
}

func TestJoinHorizontal(t *testing.T) {
type test struct {
name string
result string
expected string
}
tests := []test{
{"pos0", JoinHorizontal(Top, "A", "B\nB\nB\nB"), "AB\n B\n B\n B"},
{"pos1", JoinHorizontal(Bottom, "A", "B\nB\nB\nB"), " B\n B\n B\nAB"},
{"pos0.25", JoinHorizontal(0.25, "A", "B\nB\nB\nB"), " B\nAB\n B\n B"},
}

for _, test := range tests {
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)
}
})
}
}

0 comments on commit b1d066a

Please sign in to comment.