-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtest_window.nim
85 lines (55 loc) · 1.62 KB
/
test_window.nim
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
import std/unittest
import uing
suite "Test Window":
# setup
init()
let window = newWindow("Window Test", 200, 200)
let child = newGroup("Test")
# tests
test "Window can be set margined":
window.margined = true
window.margined = false
test "Window can get margined":
check not window.margined
test "Window can be set resizeable":
window.resizeable = true
window.resizeable = false
test "Window can get resizeable":
check not window.resizeable
test "Window can be set borderless":
window.borderless = true
window.borderless = false
test "Window can get borderless":
check not window.borderless
test "Window can get focused":
#check window.focused
discard
test "Window can be set fullscreen":
window.fullscreen = true
window.fullscreen = false
test "Window can get fullscreen":
check not window.fullscreen
test "Window can set content size":
window.contentSize = (400, 400)
test "Window can get content size":
check window.contentSize == (400, 400)
test "Window can set title":
window.title = "Window Test Test"
test "Window can get title":
check window.title == "Window Test Test"
test "Window can set position":
window.position = (0, 0)
test "Window can get position":
check window.position == (0, 0)
test "Window can set child":
window.child = child
test "Window can get child":
let winChild = window.child
#? Should be the same?
check winChild.signature == child.signature
# * dialogs are blocking, not tested
# teardown
show window
mainSteps()
mainStep(1)
uing.quit()