mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-03 20:14:22 +02:00
Refactor PTY
PTY now provides a public interface to an underlying instance of PTYNative. The PTYNative class can be extended as appropriate for each platform and the platform-specific implementation will be selected by PTY at runtime.
This commit is contained in:
parent
d11853e9f6
commit
df32ee3c18
8 changed files with 539 additions and 333 deletions
|
@ -24,6 +24,62 @@ func test_fork_succeeds():
|
|||
assert_eq(err, OK)
|
||||
|
||||
|
||||
func test_fork_has_output():
|
||||
pty.call_deferred("fork", "exit")
|
||||
yield(yield_to(pty, "data_received", 1), YIELD)
|
||||
var expected := PoolByteArray(
|
||||
[
|
||||
101,
|
||||
120,
|
||||
101,
|
||||
99,
|
||||
118,
|
||||
112,
|
||||
40,
|
||||
51,
|
||||
41,
|
||||
32,
|
||||
102,
|
||||
97,
|
||||
105,
|
||||
108,
|
||||
101,
|
||||
100,
|
||||
46,
|
||||
58,
|
||||
32,
|
||||
78,
|
||||
111,
|
||||
32,
|
||||
115,
|
||||
117,
|
||||
99,
|
||||
104,
|
||||
32,
|
||||
102,
|
||||
105,
|
||||
108,
|
||||
101,
|
||||
32,
|
||||
111,
|
||||
114,
|
||||
32,
|
||||
100,
|
||||
105,
|
||||
114,
|
||||
101,
|
||||
99,
|
||||
116,
|
||||
111,
|
||||
114,
|
||||
121,
|
||||
13,
|
||||
10
|
||||
]
|
||||
)
|
||||
assert_signal_emitted_with_parameters(pty, "data_received", [expected])
|
||||
|
||||
|
||||
func test_open_succeeds():
|
||||
var result = pty.open()
|
||||
assert_eq(result[0], OK)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue