|
@@ -35,15 +35,6 @@
|
|
|
#include "tests/test_macros.h"
|
|
|
|
|
|
namespace TestTextEdit {
|
|
|
-static inline Array build_array() {
|
|
|
- return Array();
|
|
|
-}
|
|
|
-template <typename... Targs>
|
|
|
-static inline Array build_array(Variant item, Targs... Fargs) {
|
|
|
- Array a = build_array(Fargs...);
|
|
|
- a.push_front(item);
|
|
|
- return a;
|
|
|
-}
|
|
|
static inline Array reverse_nested(Array array) {
|
|
|
Array reversed_array = array.duplicate(true);
|
|
|
reversed_array.reverse();
|
|
@@ -69,7 +60,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_WATCH(text_edit, "lines_edited_from");
|
|
|
SIGNAL_WATCH(text_edit, "caret_changed");
|
|
|
|
|
|
- Array lines_edited_args = build_array(build_array(0, 0), build_array(0, 0));
|
|
|
+ Array lines_edited_args = { { 0, 0 }, { 0, 0 } };
|
|
|
|
|
|
SUBCASE("[TextEdit] clear and set text") {
|
|
|
// "text_changed" should not be emitted on clear / set.
|
|
@@ -134,7 +125,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
// Can clear even if not editable.
|
|
|
text_edit->set_editable(false);
|
|
|
|
|
|
- Array lines_edited_clear_args = build_array(build_array(1, 0));
|
|
|
+ Array lines_edited_clear_args = { { 1, 0 } };
|
|
|
|
|
|
text_edit->clear();
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -232,7 +223,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_CHECK_FALSE("text_set");
|
|
|
|
|
|
// Insert text when there is no text.
|
|
|
- lines_edited_args = build_array(build_array(0, 0));
|
|
|
+ lines_edited_args = { { 0, 0 } };
|
|
|
|
|
|
text_edit->insert_text("tes", 0, 0);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -245,7 +236,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_CHECK_FALSE("text_set");
|
|
|
|
|
|
// Insert multiple lines.
|
|
|
- lines_edited_args = build_array(build_array(0, 1));
|
|
|
+ lines_edited_args = { { 0, 1 } };
|
|
|
|
|
|
text_edit->insert_text("t\ninserting text", 0, 3);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -258,7 +249,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_CHECK_FALSE("text_set");
|
|
|
|
|
|
// Can insert even if not editable.
|
|
|
- lines_edited_args = build_array(build_array(1, 1));
|
|
|
+ lines_edited_args = { { 1, 1 } };
|
|
|
|
|
|
text_edit->set_editable(false);
|
|
|
text_edit->insert_text("mid", 1, 2);
|
|
@@ -300,7 +291,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->select(1, 4, 1, 6, 2);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(1, 2));
|
|
|
+ lines_edited_args = { { 1, 2 } };
|
|
|
|
|
|
text_edit->insert_text("\n ", 1, 2);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -334,7 +325,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 0));
|
|
|
+ lines_edited_args = { { 0, 0 } };
|
|
|
|
|
|
text_edit->insert_text("a", 0, 4, true, false);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -361,7 +352,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 0));
|
|
|
+ lines_edited_args = { { 0, 0 } };
|
|
|
|
|
|
text_edit->insert_text("a", 0, 4, false, false);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -388,7 +379,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 0));
|
|
|
+ lines_edited_args = { { 0, 0 } };
|
|
|
|
|
|
text_edit->insert_text("a", 0, 4, true, true);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -415,7 +406,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 0));
|
|
|
+ lines_edited_args = { { 0, 0 } };
|
|
|
|
|
|
text_edit->insert_text("a", 0, 4, false, true);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -429,7 +420,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
}
|
|
|
|
|
|
SUBCASE("[TextEdit] remove text") {
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(0, 2));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 0, 2 } };
|
|
|
|
|
|
text_edit->set_text("test\nremoveing text\nthird line");
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -454,7 +445,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->set_caret_column(10);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(2, 1));
|
|
|
+ lines_edited_args = { { 2, 1 } };
|
|
|
|
|
|
text_edit->remove_text(1, 9, 2, 2);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -467,7 +458,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_CHECK_FALSE("text_set");
|
|
|
|
|
|
// Can remove even if not editable.
|
|
|
- lines_edited_args = build_array(build_array(1, 1));
|
|
|
+ lines_edited_args = { { 1, 1 } };
|
|
|
|
|
|
text_edit->set_editable(false);
|
|
|
text_edit->remove_text(1, 5, 1, 6);
|
|
@@ -683,7 +674,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("text_set");
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(0, 1));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 0, 1 } };
|
|
|
|
|
|
text_edit->set_line(0, "multiple\nlines");
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -702,7 +693,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
}
|
|
|
|
|
|
SUBCASE("[TextEdit] swap lines") {
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(0, 1));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 0, 1 } };
|
|
|
|
|
|
text_edit->set_text("testing\nswap");
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -716,7 +707,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_CHECK("caret_changed", empty_signal_args);
|
|
|
// Emitted twice for each line.
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(0, 0), build_array(1, 1), build_array(1, 1));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 0, 0 }, { 1, 1 }, { 1, 1 } };
|
|
|
|
|
|
// Order does not matter. Works when not editable.
|
|
|
text_edit->set_editable(false);
|
|
@@ -770,7 +761,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->add_caret(1, 6);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(1, 1), build_array(1, 1), build_array(0, 0), build_array(0, 0));
|
|
|
+ lines_edited_args = { { 1, 1 }, { 1, 1 }, { 0, 0 }, { 0, 0 } };
|
|
|
|
|
|
text_edit->swap_lines(0, 1);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -799,7 +790,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
- lines_edited_args = build_array(build_array(2, 2), build_array(2, 2), build_array(0, 0), build_array(0, 0));
|
|
|
+ lines_edited_args = { { 2, 2 }, { 2, 2 }, { 0, 0 }, { 0, 0 } };
|
|
|
|
|
|
text_edit->swap_lines(0, 2);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -813,7 +804,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
}
|
|
|
|
|
|
SUBCASE("[TextEdit] insert line at") {
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(0, 1));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 0, 1 } };
|
|
|
|
|
|
text_edit->set_text("testing\nswap");
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -832,7 +823,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
|
|
|
// Insert line at inserts a line before and moves caret and selection. Works when not editable.
|
|
|
text_edit->set_editable(false);
|
|
|
- lines_edited_args = build_array(build_array(0, 1));
|
|
|
+ lines_edited_args = { { 0, 1 } };
|
|
|
text_edit->insert_line_at(0, "new");
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
CHECK(text_edit->get_text() == "new\ntesting\nswap");
|
|
@@ -875,7 +866,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
CHECK(text_edit->get_selection_from_line() == 0);
|
|
|
CHECK(text_edit->get_selection_to_line() == 2);
|
|
|
SIGNAL_CHECK_FALSE("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(2, 3));
|
|
|
+ lines_edited_args = { { 2, 3 } };
|
|
|
|
|
|
text_edit->insert_line_at(2, "after");
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -907,7 +898,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->select(0, 1, 2, 2);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(2, 4));
|
|
|
+ lines_edited_args = { { 2, 4 } };
|
|
|
|
|
|
text_edit->insert_line_at(2, "multiple\nlines");
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -924,7 +915,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
}
|
|
|
|
|
|
SUBCASE("[TextEdit] remove line at") {
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(0, 5));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 0, 5 } };
|
|
|
text_edit->set_text("testing\nremove line at\n\tremove\nlines\n\ntest");
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
CHECK(text_edit->get_text() == "testing\nremove line at\n\tremove\nlines\n\ntest");
|
|
@@ -943,7 +934,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->add_caret(1, 5);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(3, 2));
|
|
|
+ lines_edited_args = { { 3, 2 } };
|
|
|
|
|
|
text_edit->remove_line_at(2, true);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -978,7 +969,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->add_caret(4, 4);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(1, 0));
|
|
|
+ lines_edited_args = { { 1, 0 } };
|
|
|
|
|
|
text_edit->remove_line_at(0, false);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -999,7 +990,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->set_caret_column(0);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(3, 2));
|
|
|
+ lines_edited_args = { { 3, 2 } };
|
|
|
|
|
|
text_edit->remove_line_at(2, false);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -1016,7 +1007,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->set_caret_column(2);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(2, 1));
|
|
|
+ lines_edited_args = { { 2, 1 } };
|
|
|
|
|
|
text_edit->remove_line_at(2, true);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -1052,7 +1043,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->set_caret_column(2);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(1, 0));
|
|
|
+ lines_edited_args = { { 1, 0 } };
|
|
|
|
|
|
text_edit->remove_line_at(1, false);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -1092,7 +1083,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->set_caret_column(10);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 0));
|
|
|
+ lines_edited_args = { { 0, 0 } };
|
|
|
|
|
|
text_edit->remove_line_at(0);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -1107,7 +1098,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
}
|
|
|
|
|
|
SUBCASE("[TextEdit] insert text at caret") {
|
|
|
- lines_edited_args = build_array(build_array(0, 1));
|
|
|
+ lines_edited_args = { { 0, 1 } };
|
|
|
|
|
|
// Insert text at caret can insert multiple lines.
|
|
|
text_edit->insert_text_at_caret("testing\nswap");
|
|
@@ -1126,7 +1117,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
|
|
|
- lines_edited_args = build_array(build_array(0, 0));
|
|
|
+ lines_edited_args = { { 0, 0 } };
|
|
|
text_edit->insert_text_at_caret("mid");
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
CHECK(text_edit->get_text() == "temidsting\nswap");
|
|
@@ -1140,7 +1131,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
// Selections are deleted then text is inserted. It also works even if not editable.
|
|
|
text_edit->select(0, 0, 0, text_edit->get_line(0).length());
|
|
|
CHECK(text_edit->has_selection());
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(0, 0));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 0, 0 } };
|
|
|
|
|
|
text_edit->set_editable(false);
|
|
|
text_edit->insert_text_at_caret("new line");
|
|
@@ -1213,7 +1204,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_WATCH(text_edit, "lines_edited_from");
|
|
|
SIGNAL_WATCH(text_edit, "caret_changed");
|
|
|
|
|
|
- Array lines_edited_args = build_array(build_array(0, 0), build_array(0, 0));
|
|
|
+ Array lines_edited_args = { { 0, 0 }, { 0, 0 } };
|
|
|
|
|
|
SUBCASE("[TextEdit] select all") {
|
|
|
// Select when there is no text does not select.
|
|
@@ -2822,7 +2813,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_WATCH(text_edit, "lines_edited_from");
|
|
|
SIGNAL_WATCH(text_edit, "caret_changed");
|
|
|
|
|
|
- Array lines_edited_args = build_array(build_array(0, 0));
|
|
|
+ Array lines_edited_args = { { 0, 0 } };
|
|
|
|
|
|
SUBCASE("[TextEdit] backspace") {
|
|
|
text_edit->set_text("this is\nsome\n");
|
|
@@ -2846,7 +2837,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->set_caret_column(0);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(2, 1));
|
|
|
+ lines_edited_args = { { 2, 1 } };
|
|
|
|
|
|
text_edit->backspace();
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -2858,7 +2849,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_CHECK("lines_edited_from", lines_edited_args);
|
|
|
|
|
|
// Backspace removes a character.
|
|
|
- lines_edited_args = build_array(build_array(1, 1));
|
|
|
+ lines_edited_args = { { 1, 1 } };
|
|
|
text_edit->backspace();
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
CHECK(text_edit->get_text() == "this is\nsom");
|
|
@@ -2925,7 +2916,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(1, 0));
|
|
|
+ lines_edited_args = { { 1, 0 } };
|
|
|
|
|
|
text_edit->cut();
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -2967,7 +2958,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 0));
|
|
|
+ lines_edited_args = { { 0, 0 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_cut");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -3015,7 +3006,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(1, 0), build_array(1, 0));
|
|
|
+ lines_edited_args = { { 1, 0 }, { 1, 0 } };
|
|
|
|
|
|
text_edit->cut();
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -3042,7 +3033,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->set_caret_column(2);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 0));
|
|
|
+ lines_edited_args = { { 0, 0 } };
|
|
|
|
|
|
text_edit->cut();
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -3078,7 +3069,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(1, 0), build_array(3, 2), build_array(2, 1));
|
|
|
+ lines_edited_args = { { 1, 0 }, { 3, 2 }, { 2, 1 } };
|
|
|
|
|
|
text_edit->cut();
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -3107,7 +3098,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(1, 1), build_array(4, 3), build_array(0, 0));
|
|
|
+ lines_edited_args = { { 1, 1 }, { 4, 3 }, { 0, 0 } };
|
|
|
|
|
|
text_edit->cut();
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -3273,7 +3264,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(1, 1));
|
|
|
+ lines_edited_args = { { 1, 1 } };
|
|
|
DS->clipboard_set("paste");
|
|
|
|
|
|
text_edit->paste();
|
|
@@ -3318,7 +3309,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(2, 2));
|
|
|
+ lines_edited_args = { { 2, 2 } };
|
|
|
DS->clipboard_set("paste2");
|
|
|
|
|
|
SEND_GUI_ACTION("ui_paste");
|
|
@@ -3339,7 +3330,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(1, 0), build_array(0, 0));
|
|
|
+ lines_edited_args = { { 1, 0 }, { 0, 0 } };
|
|
|
DS->clipboard_set("paste");
|
|
|
|
|
|
text_edit->paste();
|
|
@@ -3362,7 +3353,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 3));
|
|
|
+ lines_edited_args = { { 0, 3 } };
|
|
|
DS->clipboard_set("multi\n\nline\npaste");
|
|
|
|
|
|
text_edit->paste();
|
|
@@ -3384,7 +3375,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(1, 2));
|
|
|
+ lines_edited_args = { { 1, 2 } };
|
|
|
DS->clipboard_set("");
|
|
|
text_edit->copy();
|
|
|
text_edit->set_caret_column(3);
|
|
@@ -3411,7 +3402,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 1));
|
|
|
+ lines_edited_args = { { 0, 1 } };
|
|
|
DS->clipboard_set("paste\n");
|
|
|
|
|
|
text_edit->paste();
|
|
@@ -3435,7 +3426,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 1), build_array(2, 3), build_array(5, 6));
|
|
|
+ lines_edited_args = { { 0, 1 }, { 2, 3 }, { 5, 6 } };
|
|
|
DS->clipboard_set("paste\ntest");
|
|
|
|
|
|
text_edit->paste();
|
|
@@ -3465,7 +3456,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(1, 1), build_array(3, 3));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 1, 1 }, { 3, 3 } };
|
|
|
DS->clipboard_set("paste\ntest\n1");
|
|
|
|
|
|
text_edit->paste();
|
|
@@ -3546,7 +3537,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(3, 4));
|
|
|
+ lines_edited_args = { { 3, 4 } };
|
|
|
|
|
|
SEND_GUI_MOUSE_BUTTON_EVENT(text_edit->get_rect_at_line_column(3, 2).get_center() + Point2i(2, 0), MouseButton::MIDDLE, MouseButtonMask::MIDDLE, Key::NONE);
|
|
|
CHECK(DS->clipboard_get_primary() == "is is\nsom");
|
|
@@ -3567,7 +3558,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
DS->clipboard_set_primary("paste");
|
|
|
- lines_edited_args = build_array(build_array(0, 0));
|
|
|
+ lines_edited_args = { { 0, 0 } };
|
|
|
|
|
|
text_edit->paste_primary_clipboard();
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -3592,7 +3583,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
DS->clipboard_set_primary("paste");
|
|
|
- lines_edited_args = build_array(build_array(1, 1), build_array(2, 2));
|
|
|
+ lines_edited_args = { { 1, 1 }, { 2, 2 } };
|
|
|
|
|
|
text_edit->paste_primary_clipboard();
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -3693,7 +3684,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_WATCH(text_edit, "lines_edited_from");
|
|
|
SIGNAL_WATCH(text_edit, "caret_changed");
|
|
|
|
|
|
- Array lines_edited_args = build_array(build_array(0, 0));
|
|
|
+ Array lines_edited_args = { { 0, 0 } };
|
|
|
|
|
|
SUBCASE("[TextEdit] ui_text_newline_above") {
|
|
|
text_edit->set_text("this is some test text.\nthis is some test text.");
|
|
@@ -3709,7 +3700,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
CHECK(text_edit->get_caret_count() == 2);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 1), build_array(2, 3));
|
|
|
+ lines_edited_args = { { 0, 1 }, { 2, 3 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_newline_above");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -3781,7 +3772,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->select(1, 10, 0, 0);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 1), build_array(4, 5));
|
|
|
+ lines_edited_args = { { 0, 1 }, { 4, 5 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_newline_above");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -3806,7 +3797,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 1), build_array(1, 2));
|
|
|
+ lines_edited_args = { { 0, 1 }, { 1, 2 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_newline_above");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -3835,7 +3826,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
CHECK(text_edit->get_caret_count() == 2);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 1), build_array(2, 3));
|
|
|
+ lines_edited_args = { { 0, 1 }, { 2, 3 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_newline_blank");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -3906,7 +3897,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 1), build_array(0, 1));
|
|
|
+ lines_edited_args = { { 0, 1 }, { 0, 1 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_newline_blank");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -3937,7 +3928,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
// Lines edited: deletion, insert line, insert line.
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(0, 1), build_array(2, 3));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 0, 1 }, { 2, 3 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_newline");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -4015,7 +4006,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->set_caret_column(5);
|
|
|
text_edit->add_caret(1, 2);
|
|
|
text_edit->add_caret(1, 8);
|
|
|
- lines_edited_args = build_array(build_array(1, 1));
|
|
|
+ lines_edited_args = { { 1, 1 } };
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
|
|
@@ -4066,7 +4057,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->select(3, 7, 3, 4, 1);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(3, 3), build_array(1, 1));
|
|
|
+ lines_edited_args = { { 3, 3 }, { 1, 1 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_backspace_all_to_left");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -4087,7 +4078,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->set_caret_column(0, false, 1);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(3, 2), build_array(1, 0));
|
|
|
+ lines_edited_args = { { 3, 2 }, { 1, 0 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_backspace_all_to_left");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -4126,7 +4117,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->set_editable(true);
|
|
|
|
|
|
// Remove entire line content when at the end of the line.
|
|
|
- lines_edited_args = build_array(build_array(1, 1), build_array(0, 0));
|
|
|
+ lines_edited_args = { { 1, 1 }, { 0, 0 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_backspace_all_to_left");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -4189,7 +4180,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->select(3, 10, 3, 6, 1);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(3, 3), build_array(1, 1));
|
|
|
+ lines_edited_args = { { 3, 3 }, { 1, 1 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_backspace_word");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -4206,7 +4197,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_CHECK("lines_edited_from", lines_edited_args);
|
|
|
text_edit->end_complex_operation();
|
|
|
|
|
|
- lines_edited_args = build_array(build_array(3, 2), build_array(1, 0));
|
|
|
+ lines_edited_args = { { 3, 2 }, { 1, 0 } };
|
|
|
|
|
|
// Start of line should also be a normal backspace.
|
|
|
text_edit->set_caret_column(0);
|
|
@@ -4253,7 +4244,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->set_caret_column(12, false, 1);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(1, 1), build_array(0, 0));
|
|
|
+ lines_edited_args = { { 1, 1 }, { 0, 0 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_backspace_word");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -4359,7 +4350,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(0, 0));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 0, 0 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_backspace_word");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -4423,7 +4414,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->select(3, 5, 3, 2, 1);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(3, 3), build_array(1, 1));
|
|
|
+ lines_edited_args = { { 3, 3 }, { 1, 1 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_backspace");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -4478,7 +4469,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->set_caret_column(0, false, 1);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(3, 2), build_array(1, 0));
|
|
|
+ lines_edited_args = { { 3, 2 }, { 1, 0 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_backspace");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -4550,7 +4541,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->start_action(TextEdit::ACTION_NONE);
|
|
|
|
|
|
// Backspace removes character to the left.
|
|
|
- lines_edited_args = build_array(build_array(1, 1), build_array(0, 0));
|
|
|
+ lines_edited_args = { { 1, 1 }, { 0, 0 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_backspace");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -4582,7 +4573,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_CHECK("lines_edited_from", lines_edited_args);
|
|
|
|
|
|
// Undo both backspaces.
|
|
|
- lines_edited_args = build_array(build_array(1, 1), build_array(0, 0), build_array(1, 1), build_array(0, 0));
|
|
|
+ lines_edited_args = { { 1, 1 }, { 0, 0 }, { 1, 1 }, { 0, 0 } };
|
|
|
|
|
|
text_edit->undo();
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -4621,7 +4612,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->add_caret(0, 9);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(0, 0), build_array(0, 0));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 0, 0 }, { 0, 0 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_backspace");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -4640,7 +4631,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->select(1, text_edit->get_line(1).length(), 1, 0, 1);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(1, 1), build_array(0, 0));
|
|
|
+ lines_edited_args = { { 1, 1 }, { 0, 0 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_backspace");
|
|
|
CHECK(text_edit->get_text() == "\n");
|
|
@@ -4692,7 +4683,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->add_caret(0, 20);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 0));
|
|
|
+ lines_edited_args = { { 0, 0 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_delete_all_to_right");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -4706,7 +4697,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_CHECK("lines_edited_from", lines_edited_args);
|
|
|
|
|
|
// Undo.
|
|
|
- lines_edited_args = build_array(build_array(0, 0));
|
|
|
+ lines_edited_args = { { 0, 0 } };
|
|
|
|
|
|
text_edit->undo();
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -4743,7 +4734,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->select(1, 8, 1, 4, 1);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(1, 1));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 1, 1 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_delete_all_to_right");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -4836,7 +4827,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->select(2, 10, 2, 6, 1);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(2, 2));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 2, 2 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_delete_word");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -4857,7 +4848,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->set_caret_column(text_edit->get_line(2).length(), false, 1);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(1, 0), build_array(2, 1));
|
|
|
+ lines_edited_args = { { 1, 0 }, { 2, 1 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_delete_word");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -4899,7 +4890,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->start_action(TextEdit::ACTION_NONE);
|
|
|
|
|
|
// Delete to the end of the word right of the caret.
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(1, 1));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 1, 1 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_delete_word");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -4952,7 +4943,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->set_caret_column(6);
|
|
|
text_edit->add_caret(0, 9);
|
|
|
text_edit->add_caret(0, 3);
|
|
|
- lines_edited_args = build_array(build_array(0, 0));
|
|
|
+ lines_edited_args = { { 0, 0 } };
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("text_set");
|
|
|
SIGNAL_DISCARD("text_changed");
|
|
@@ -5030,7 +5021,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(0, 0));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 0, 0 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_delete_word");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -5046,7 +5037,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_CHECK("text_changed", empty_signal_args);
|
|
|
SIGNAL_CHECK("lines_edited_from", lines_edited_args);
|
|
|
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(0, 0));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 0, 0 } };
|
|
|
|
|
|
text_edit->undo();
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -5100,7 +5091,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->select(2, 5, 2, 2, 1);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(2, 2));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 2, 2 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_delete");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -5156,7 +5147,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->set_caret_column(text_edit->get_line(2).length(), false, 1);
|
|
|
MessageQueue::get_singleton()->flush();
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
- lines_edited_args = build_array(build_array(1, 0), build_array(2, 1));
|
|
|
+ lines_edited_args = { { 1, 0 }, { 2, 1 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_delete");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -5228,7 +5219,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->start_action(TextEdit::EditAction::ACTION_NONE);
|
|
|
|
|
|
// Delete removes character to the right.
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(1, 1));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 1, 1 } };
|
|
|
|
|
|
SEND_GUI_ACTION("ui_text_delete");
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -5260,7 +5251,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_CHECK("lines_edited_from", lines_edited_args);
|
|
|
|
|
|
// Undo both deletes.
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(1, 1), build_array(0, 0), build_array(1, 1));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 1, 1 }, { 0, 0 }, { 1, 1 } };
|
|
|
|
|
|
text_edit->undo();
|
|
|
MessageQueue::get_singleton()->flush();
|
|
@@ -6291,7 +6282,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_DISCARD("lines_edited_from");
|
|
|
SIGNAL_DISCARD("caret_changed");
|
|
|
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(1, 1));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 1, 1 } };
|
|
|
|
|
|
SEND_GUI_KEY_EVENT(Key::A);
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -6334,7 +6325,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
SIGNAL_CHECK_FALSE("lines_edited_from");
|
|
|
text_edit->set_editable(true);
|
|
|
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(0, 0), build_array(1, 1), build_array(1, 1));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 0, 0 }, { 1, 1 }, { 1, 1 } };
|
|
|
|
|
|
text_edit->select(0, 0, 0, 1);
|
|
|
text_edit->select(1, 0, 1, 1, 1);
|
|
@@ -6371,7 +6362,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
|
|
|
text_edit->set_overtype_mode_enabled(false);
|
|
|
CHECK_FALSE(text_edit->is_overtype_mode_enabled());
|
|
|
|
|
|
- lines_edited_args = build_array(build_array(0, 0), build_array(1, 1));
|
|
|
+ lines_edited_args = { { 0, 0 }, { 1, 1 } };
|
|
|
|
|
|
SEND_GUI_KEY_EVENT(Key::TAB);
|
|
|
CHECK(text_edit->get_viewport()->is_input_handled());
|
|
@@ -8252,12 +8243,12 @@ TEST_CASE("[SceneTree][TextEdit] gutters") {
|
|
|
// Click on gutter.
|
|
|
SEND_GUI_MOUSE_BUTTON_EVENT(Point2(5, line_height / 2), MouseButton::LEFT, MouseButtonMask::LEFT, Key::NONE);
|
|
|
CHECK(text_edit->get_hovered_gutter() == Vector2i(0, 0));
|
|
|
- SIGNAL_CHECK("gutter_clicked", build_array(build_array(0, 0)));
|
|
|
+ SIGNAL_CHECK("gutter_clicked", Array({ { 0, 0 } }));
|
|
|
|
|
|
// Click on gutter on another line.
|
|
|
SEND_GUI_MOUSE_BUTTON_EVENT(Point2(5, line_height * 3 + line_height / 2), MouseButton::LEFT, MouseButtonMask::LEFT, Key::NONE);
|
|
|
CHECK(text_edit->get_hovered_gutter() == Vector2i(0, 3));
|
|
|
- SIGNAL_CHECK("gutter_clicked", build_array(build_array(3, 0)));
|
|
|
+ SIGNAL_CHECK("gutter_clicked", Array({ { 3, 0 } }));
|
|
|
|
|
|
// Unclickable gutter can be hovered.
|
|
|
SEND_GUI_MOUSE_MOTION_EVENT(Point2(15, line_height + line_height / 2), MouseButtonMask::NONE, Key::NONE);
|
|
@@ -8268,7 +8259,7 @@ TEST_CASE("[SceneTree][TextEdit] gutters") {
|
|
|
// Unclickable gutter can be clicked.
|
|
|
SEND_GUI_MOUSE_BUTTON_EVENT(Point2(15, line_height * 2 + line_height / 2), MouseButton::LEFT, MouseButtonMask::LEFT, Key::NONE);
|
|
|
CHECK(text_edit->get_hovered_gutter() == Vector2i(1, 2));
|
|
|
- SIGNAL_CHECK("gutter_clicked", build_array(build_array(2, 1)));
|
|
|
+ SIGNAL_CHECK("gutter_clicked", Array({ { 2, 1 } }));
|
|
|
CHECK(DS->get_cursor_shape() == DisplayServer::CURSOR_ARROW);
|
|
|
|
|
|
// Hover past last line.
|