-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjoin_test.go
More file actions
50 lines (44 loc) · 761 Bytes
/
join_test.go
File metadata and controls
50 lines (44 loc) · 761 Bytes
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
package lipbalm
import (
"fmt"
"os"
"testing"
"github.com/crolbar/lipbalm/assert"
)
func TestVJoin(t *testing.T) {
assert.Equal(t,
getDump("vertJoinExpect"),
JoinVertical(Left,
getDump("bar1"),
getDump("bar2"),
),
)
}
func TestHJoin(t *testing.T) {
assert.Equal(t,
getDump("horiJoinExpect"),
JoinHorizontal(Left,
getDump("bar1"),
getDump("bar2"),
),
)
}
func TestBothJoin(t *testing.T) {
assert.Equal(t,
getDump("go29_screen"),
JoinHorizontal(Top,
JoinVertical(Right,
getDump("go29_wheel"),
getDump("go29_bp"),
),
getDump("go29_slider"),
),
)
}
func getDump(name string) string {
data, err := os.ReadFile(fmt.Sprintf("tests/%s.dump", name))
if err != nil {
panic(err)
}
return string(data)
}