mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-22 09:40:25 +01:00
Fix winsize test to support unsigned short
The type of winsize.ws_col and winsize.ws_row is unsigned short, so change python's struct.unpack format from 'hh' (short) to 'HH'. Otherwise, we can only test sizes up to 32767 when actually sizes up to 65535 are supported.
This commit is contained in:
parent
ed05f79073
commit
38927e0a3e
1 changed files with 10 additions and 1 deletions
|
@ -54,6 +54,15 @@ func test_open_pty_has_correct_win_size():
|
|||
assert_eq(winsize.rows, rows)
|
||||
|
||||
|
||||
func test_win_size_supports_max_unsigned_short_value():
|
||||
var cols = 65535
|
||||
var rows = 65535
|
||||
var result = pty.open(cols, rows)
|
||||
var winsize = helper._get_winsize(result[1].master)
|
||||
assert_eq(winsize.cols, cols)
|
||||
assert_eq(winsize.cols, rows)
|
||||
|
||||
|
||||
func test_closes_pty_on_exit():
|
||||
var num_pts = helper._get_pts().size()
|
||||
pty.fork("sleep", ["1000"])
|
||||
|
@ -83,7 +92,7 @@ class Helper:
|
|||
[
|
||||
"-c",
|
||||
(
|
||||
"import struct, fcntl, termios; print(struct.unpack('hh', fcntl.ioctl(%d, termios.TIOCGWINSZ, '1234')))"
|
||||
"import struct, fcntl, termios; print(struct.unpack('HH', fcntl.ioctl(%d, termios.TIOCGWINSZ, '1234')))"
|
||||
% fd
|
||||
)
|
||||
],
|
||||
|
|
Loading…
Reference in a new issue