mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-03 20:14:22 +02:00
Kill child process and close pty on exit
- Adds kill() method to LibuvUtils. - Adds close() method to Pipe.
This commit is contained in:
parent
55b0a0577d
commit
c81da3820b
10 changed files with 53 additions and 9 deletions
|
@ -1,5 +1,7 @@
|
|||
extends "res://addons/gut/test.gd"
|
||||
|
||||
const LibuvUtils := preload("res://addons/godot_xterm/nodes/pty/libuv_utils.gd")
|
||||
|
||||
var pty: GDXterm.PTYUnix
|
||||
var helper: Helper
|
||||
|
||||
|
@ -51,6 +53,16 @@ func test_open_pty_has_correct_win_size():
|
|||
assert_eq(winsize.rows, rows)
|
||||
|
||||
|
||||
func test_closes_pty_on_exit():
|
||||
var num_pts = helper._get_pts().size()
|
||||
pty.fork("sleep", ["1000"])
|
||||
remove_child(pty)
|
||||
pty.free()
|
||||
yield(yield_for(1), YIELD)
|
||||
var new_num_pts = helper._get_pts().size()
|
||||
assert_eq(new_num_pts, num_pts)
|
||||
|
||||
|
||||
class Helper:
|
||||
static func _get_pts() -> Array:
|
||||
assert(false, "Abstract method")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue