mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-10 04:40:25 +01:00
feat(pty): rename get_pts() -> get_pts_name()
This commit is contained in:
parent
c6609ebae5
commit
b78bdf3136
4 changed files with 12 additions and 11 deletions
|
@ -62,7 +62,7 @@ void PTY::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("is_using_threads"), &PTY::is_using_threads);
|
ClassDB::bind_method(D_METHOD("is_using_threads"), &PTY::is_using_threads);
|
||||||
ClassDB::add_property("PTY", PropertyInfo(Variant::BOOL, "use_threads"), "set_use_threads", "is_using_threads");
|
ClassDB::add_property("PTY", PropertyInfo(Variant::BOOL, "use_threads"), "set_use_threads", "is_using_threads");
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_pts"), &PTY::get_pts);
|
ClassDB::bind_method(D_METHOD("get_pts_name"), &PTY::get_pts_name);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("fork", "file", "args", "cwd", "cols", "rows"), &PTY::fork, DEFVAL(""), DEFVAL(PackedStringArray()), DEFVAL("."), DEFVAL(80), DEFVAL(24));
|
ClassDB::bind_method(D_METHOD("fork", "file", "args", "cwd", "cols", "rows"), &PTY::fork, DEFVAL(""), DEFVAL(PackedStringArray()), DEFVAL("."), DEFVAL(80), DEFVAL(24));
|
||||||
ClassDB::bind_method(D_METHOD("open", "cols", "rows"), &PTY::open, DEFVAL(80), DEFVAL(24));
|
ClassDB::bind_method(D_METHOD("open", "cols", "rows"), &PTY::open, DEFVAL(80), DEFVAL(24));
|
||||||
|
@ -126,8 +126,8 @@ bool PTY::is_using_threads() const {
|
||||||
return use_threads;
|
return use_threads;
|
||||||
}
|
}
|
||||||
|
|
||||||
String PTY::get_pts() const {
|
String PTY::get_pts_name() const {
|
||||||
return pts;
|
return pts_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
Error PTY::fork(const String &file, const PackedStringArray &args, const String &cwd, const int cols, const int rows) {
|
Error PTY::fork(const String &file, const PackedStringArray &args, const String &cwd, const int cols, const int rows) {
|
||||||
|
@ -145,7 +145,7 @@ Error PTY::fork(const String &file, const PackedStringArray &args, const String
|
||||||
|
|
||||||
fd = result["fd"];
|
fd = result["fd"];
|
||||||
pid = result["pid"];
|
pid = result["pid"];
|
||||||
pts = result["pty"];
|
pts_name = result["pty"];
|
||||||
|
|
||||||
status = STATUS_OPEN;
|
status = STATUS_OPEN;
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ Error PTY::open(const int cols, const int rows) {
|
||||||
Error err = static_cast<Error>((int)result["error"]);
|
Error err = static_cast<Error>((int)result["error"]);
|
||||||
ERR_FAIL_COND_V(err != OK, err);
|
ERR_FAIL_COND_V(err != OK, err);
|
||||||
|
|
||||||
pts = result["pty"];
|
pts_name = result["pty"];
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ namespace godot
|
||||||
void set_use_threads(bool p_use);
|
void set_use_threads(bool p_use);
|
||||||
bool is_using_threads() const;
|
bool is_using_threads() const;
|
||||||
|
|
||||||
String get_pts() const;
|
String get_pts_name() const;
|
||||||
|
|
||||||
Error fork(const String &file = "", const PackedStringArray &args = PackedStringArray(), const String &cwd = ".", const int cols = 80, const int rows = 24);
|
Error fork(const String &file = "", const PackedStringArray &args = PackedStringArray(), const String &cwd = ".", const int cols = 80, const int rows = 24);
|
||||||
void kill(const int signum = Signal::SIGNAL_SIGHUP);
|
void kill(const int signum = Signal::SIGNAL_SIGHUP);
|
||||||
|
@ -82,7 +82,7 @@ namespace godot
|
||||||
Dictionary env = Dictionary();
|
Dictionary env = Dictionary();
|
||||||
bool use_os_env = true;
|
bool use_os_env = true;
|
||||||
|
|
||||||
String pts = "";
|
String pts_name = "";
|
||||||
|
|
||||||
String _get_fork_file(const String &file) const;
|
String _get_fork_file(const String &file) const;
|
||||||
Dictionary _get_fork_env() const;
|
Dictionary _get_fork_env() const;
|
||||||
|
|
|
@ -43,7 +43,7 @@ func test_open_pty_has_correct_name():
|
||||||
var new_pts = helper.get_pts()
|
var new_pts = helper.get_pts()
|
||||||
for pt in original_pts:
|
for pt in original_pts:
|
||||||
new_pts.erase(pt)
|
new_pts.erase(pt)
|
||||||
assert_eq(subject.get_pts(), new_pts[0])
|
assert_eq(subject.get_pts_name(), new_pts[0])
|
||||||
|
|
||||||
|
|
||||||
func xtest_open_pty_has_correct_win_size():
|
func xtest_open_pty_has_correct_win_size():
|
||||||
|
|
|
@ -11,8 +11,6 @@ func get_described_class():
|
||||||
class TestInterface:
|
class TestInterface:
|
||||||
extends PTYTest
|
extends PTYTest
|
||||||
|
|
||||||
## API V2.
|
|
||||||
|
|
||||||
# Properties.
|
# Properties.
|
||||||
|
|
||||||
# TODO: Implement cols property.
|
# TODO: Implement cols property.
|
||||||
|
@ -46,6 +44,9 @@ class TestInterface:
|
||||||
func test_has_method_open():
|
func test_has_method_open():
|
||||||
assert_has_method_with_return_type("open", TYPE_INT)
|
assert_has_method_with_return_type("open", TYPE_INT)
|
||||||
|
|
||||||
|
func test_has_method_get_pts_name():
|
||||||
|
assert_has_method_with_return_type("get_pts_name", TYPE_STRING)
|
||||||
|
|
||||||
func test_has_method_resize():
|
func test_has_method_resize():
|
||||||
assert_has_method_with_return_type("resize", TYPE_NIL)
|
assert_has_method_with_return_type("resize", TYPE_NIL)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue