diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-01-25 18:31:31 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-01-25 18:31:31 +0000 |
commit | 9243becbedbb6a1592208051f8fa2b090dcc5e7d (patch) | |
tree | 607c2a862ec3f4399b8766383f6f8e04c4aa43b4 /test/unit/tui_spec.lua | |
parent | 9e40b6e9e1bc67f2d856adb837ee64dd0e25b717 (diff) | |
parent | 3c48d3c83fc21dbc0841f9210f04bdb073d73cd1 (diff) | |
download | rneovim-usermarks.tar.gz rneovim-usermarks.tar.bz2 rneovim-usermarks.zip |
Merge remote-tracking branch 'upstream/master' into usermarksusermarks
Diffstat (limited to 'test/unit/tui_spec.lua')
-rw-r--r-- | test/unit/tui_spec.lua | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/test/unit/tui_spec.lua b/test/unit/tui_spec.lua index 36ce4a1493..25b70a17c2 100644 --- a/test/unit/tui_spec.lua +++ b/test/unit/tui_spec.lua @@ -9,6 +9,7 @@ local cinput = cimport("./src/nvim/tui/input.h") local rbuffer = cimport("./test/unit/fixtures/rbuffer.h") local globals = cimport("./src/nvim/globals.h") local multiqueue = cimport("./test/unit/fixtures/multiqueue.h") +local ui_client = cimport("./src/nvim/ui_client.h") itp('handle_background_color', function() local handle_background_color = cinput.ut_handle_background_color @@ -33,11 +34,9 @@ itp('handle_background_color', function() term_input.waiting_for_bg_response = 1 eq(kComplete, handle_background_color(term_input)) eq(0, term_input.waiting_for_bg_response) - eq(1, multiqueue.multiqueue_size(events)) - - local event = multiqueue.multiqueue_get(events) - local bg_event = ffi.cast("Event*", event.argv[1]) - eq(bg, ffi.string(bg_event.argv[0])) + eq(0, multiqueue.multiqueue_size(events)) + eq(bg, ({[0]="light", [1] = "dark", [-1] = "none"}) + [tonumber(ui_client.ui_client_bg_response)]) -- Buffer has been consumed. eq(0, rbuf.size) @@ -114,9 +113,7 @@ itp('handle_background_color', function() eq(kComplete, handle_background_color(term_input)) eq(0, term_input.waiting_for_bg_response) - local event = multiqueue.multiqueue_get(events) - local bg_event = ffi.cast("Event*", event.argv[1]) - eq('light', ffi.string(bg_event.argv[0])) + eq(0, tonumber(ui_client.ui_client_bg_response)) eq(0, multiqueue.multiqueue_size(events)) eq(0, rbuf.size) @@ -133,9 +130,7 @@ itp('handle_background_color', function() eq(kComplete, handle_background_color(term_input)) eq(0, term_input.waiting_for_bg_response) - event = multiqueue.multiqueue_get(events) - bg_event = ffi.cast("Event*", event.argv[1]) - eq('light', ffi.string(bg_event.argv[0])) + eq(0, tonumber(ui_client.ui_client_bg_response)) eq(0, multiqueue.multiqueue_size(events)) eq(0, rbuf.size) @@ -161,7 +156,7 @@ itp('handle_background_color', function() eq(kComplete, handle_background_color(term_input)) eq(0, term_input.waiting_for_bg_response) - eq(1, multiqueue.multiqueue_size(events)) + eq(0, multiqueue.multiqueue_size(events)) eq(3, rbuf.size) rbuffer.rbuffer_consumed(rbuf, rbuf.size) end) |