Fixed .active_window test

This commit is contained in:
Yevgen Muntyan 2010-10-19 00:58:11 -07:00
parent 1f73fca09f
commit 6a775651c5

View File

@ -11,19 +11,19 @@ local function test_active_window()
w1 = editor.active_window()
tassert(w1 ~= nil, 'editor.active_window() ~= nil')
tassert(w1 == w1, 'w1 == w1')
tassert(#app.windows() == 1, 'one window')
tassert(#editor.windows() == 1, 'one window')
w2 = editor.new_window()
tassert(w2 ~= nil, 'editor.new_window() ~= nil')
tassert(w1 ~= w2, 'old window != new window')
tassert(#app.windows() == 2, 'two window')
app.set_active_window(w2)
tassert(#editor.windows() == 2, 'two window')
editor.set_active_window(w2)
_moo_utils.spin_main_loop(0.1)
tassert(w2 == editor.active_window(), 'w2 == editor.active_window()')
app.set_active_window(w1)
editor.set_active_window(w1)
_moo_utils.spin_main_loop(0.1)
tassert(w1 == editor.active_window(), 'w1 == editor.active_window()')
editor.close_window(w1)
tassert(#app.windows() == 1, 'two window')
tassert(#editor.windows() == 1, 'two window')
tassert(w2 == editor.active_window(), 'w2 == editor.active_window()')
end