@@ -93,74 +93,74 @@ TEST_CASE("Selector.Linear", "[selector]")
93
93
REQUIRE (screen.grid ().lineText (LineOffset (1 )) == " ab,cdefg,hi" );
94
94
REQUIRE (screen.grid ().lineText (LineOffset (2 )) == " 12345,67890" );
95
95
96
- SECTION (" single-cell" )
97
- { // "b"
98
- auto const pos = CellLocation { LineOffset (1 ), ColumnOffset (1 ) };
99
- auto selector = LinearSelection (selectionHelper, pos, []() {});
100
- (void ) selector.extend (pos);
101
- selector.complete ();
102
-
103
- vector<Selection::Range> const selection = selector.ranges ();
104
- REQUIRE (selection.size () == 1 );
105
- Selection::Range const & r1 = selection[0 ];
106
- CHECK (r1.line == pos.line );
107
- CHECK (r1.fromColumn == pos.column );
108
- CHECK (r1.toColumn == pos.column );
109
- CHECK (r1.length () == ColumnCount (1 ));
110
-
111
- auto selectedText = TextSelection { screen };
112
- renderSelection (selector, selectedText);
113
- CHECK (selectedText.text == " b" );
114
- }
115
-
116
- SECTION (" forward single-line" )
117
- { // "b,c"
118
- auto const pos = CellLocation { LineOffset (1 ), ColumnOffset (1 ) };
119
- auto selector = LinearSelection (selectionHelper, pos, []() {});
120
- (void ) selector.extend (CellLocation { LineOffset (1 ), ColumnOffset (3 ) });
121
- selector.complete ();
122
-
123
- vector<Selection::Range> const selection = selector.ranges ();
124
- REQUIRE (selection.size () == 1 );
125
- Selection::Range const & r1 = selection[0 ];
126
- CHECK (r1.line == LineOffset (1 ));
127
- CHECK (r1.fromColumn == ColumnOffset (1 ));
128
- CHECK (r1.toColumn == ColumnOffset (3 ));
129
- CHECK (r1.length () == ColumnCount (3 ));
130
-
131
- auto selectedText = TextSelection { screen };
132
- renderSelection (selector, selectedText);
133
- CHECK (selectedText.text == " b,c" );
134
- }
135
-
136
- SECTION (" forward multi-line" )
137
- { // "b,cdefg,hi\n1234"
138
- auto const pos = CellLocation { LineOffset (1 ), ColumnOffset (1 ) };
139
- auto selector = LinearSelection (selectionHelper, pos, []() {});
140
- (void ) selector.extend (CellLocation { LineOffset (2 ), ColumnOffset (3 ) });
141
- selector.complete ();
142
-
143
- vector<Selection::Range> const selection = selector.ranges ();
144
- REQUIRE (selection.size () == 2 );
145
-
146
- Selection::Range const & r1 = selection[0 ];
147
- CHECK (r1.line == LineOffset (1 ));
148
- CHECK (r1.fromColumn == ColumnOffset (1 ));
149
- CHECK (r1.toColumn == ColumnOffset (10 ));
150
- CHECK (r1.length () == ColumnCount (10 ));
151
-
152
- Selection::Range const & r2 = selection[1 ];
153
- CHECK (r2.line == LineOffset (2 ));
154
- CHECK (r2.fromColumn == ColumnOffset (0 ));
155
- CHECK (r2.toColumn == ColumnOffset (3 ));
156
- CHECK (r2.length () == ColumnCount (4 ));
157
-
158
- auto selectedText = TextSelection { screen };
159
- renderSelection (selector, selectedText);
160
- CHECK (selectedText.text == " b,cdefg,hi\n 1234" );
161
- }
162
-
163
- SECTION (" multiple lines fully in history" )
96
+ // SECTION("single-cell")
97
+ // { // "b"
98
+ // auto const pos = CellLocation { LineOffset(1), ColumnOffset(1) };
99
+ // auto selector = LinearSelection(selectionHelper, pos, []() {});
100
+ // (void) selector.extend(pos);
101
+ // selector.complete();
102
+ //
103
+ // vector<Selection::Range> const selection = selector.ranges();
104
+ // REQUIRE(selection.size() == 1);
105
+ // Selection::Range const& r1 = selection[0];
106
+ // CHECK(r1.line == pos.line);
107
+ // CHECK(r1.fromColumn == pos.column);
108
+ // CHECK(r1.toColumn == pos.column);
109
+ // CHECK(r1.length() == ColumnCount(1));
110
+ //
111
+ // auto selectedText = TextSelection { screen };
112
+ // renderSelection(selector, selectedText);
113
+ // CHECK(selectedText.text == "b");
114
+ // }
115
+
116
+ // SECTION("forward single-line")
117
+ // { // "b,c"
118
+ // auto const pos = CellLocation { LineOffset(1), ColumnOffset(1) };
119
+ // auto selector = LinearSelection(selectionHelper, pos, []() {});
120
+ // (void) selector.extend(CellLocation { LineOffset(1), ColumnOffset(3) });
121
+ // selector.complete();
122
+ //
123
+ // vector<Selection::Range> const selection = selector.ranges();
124
+ // REQUIRE(selection.size() == 1);
125
+ // Selection::Range const& r1 = selection[0];
126
+ // CHECK(r1.line == LineOffset(1));
127
+ // CHECK(r1.fromColumn == ColumnOffset(1));
128
+ // CHECK(r1.toColumn == ColumnOffset(3));
129
+ // CHECK(r1.length() == ColumnCount(3));
130
+ //
131
+ // auto selectedText = TextSelection { screen };
132
+ // renderSelection(selector, selectedText);
133
+ // CHECK(selectedText.text == "b,c");
134
+ // }
135
+
136
+ // SECTION("forward multi-line")
137
+ // { // "b,cdefg,hi\n1234"
138
+ // auto const pos = CellLocation { LineOffset(1), ColumnOffset(1) };
139
+ // auto selector = LinearSelection(selectionHelper, pos, []() {});
140
+ // (void) selector.extend(CellLocation { LineOffset(2), ColumnOffset(3) });
141
+ // selector.complete();
142
+ //
143
+ // vector<Selection::Range> const selection = selector.ranges();
144
+ // REQUIRE(selection.size() == 2);
145
+ //
146
+ // Selection::Range const& r1 = selection[0];
147
+ // CHECK(r1.line == LineOffset(1));
148
+ // CHECK(r1.fromColumn == ColumnOffset(1));
149
+ // CHECK(r1.toColumn == ColumnOffset(10));
150
+ // CHECK(r1.length() == ColumnCount(10));
151
+ //
152
+ // Selection::Range const& r2 = selection[1];
153
+ // CHECK(r2.line == LineOffset(2));
154
+ // CHECK(r2.fromColumn == ColumnOffset(0));
155
+ // CHECK(r2.toColumn == ColumnOffset(3));
156
+ // CHECK(r2.length() == ColumnCount(4));
157
+ //
158
+ // auto selectedText = TextSelection { screen };
159
+ // renderSelection(selector, selectedText);
160
+ // CHECK(selectedText.text == "b,cdefg,hi\n1234");
161
+ // }
162
+
163
+ // SECTION("multiple lines fully in history")
164
164
{
165
165
term.writeToScreen (" foo\r\n bar\r\n " ); // move first two lines into history.
166
166
/*
@@ -197,48 +197,48 @@ TEST_CASE("Selector.Linear", "[selector]")
197
197
CHECK (selectedText.text == " fg,hi\n 123" );
198
198
}
199
199
200
- SECTION (" multiple lines from history into main buffer" )
201
- {
202
- term.writeToScreen (" foo\r\n bar\r\n " ); // move first two lines into history.
203
- /*
204
- -3 | "12345,67890"
205
- -2 | "ab,cdefg,hi" (--
206
- -1 | "12345,67890" -----------
207
- 0 | "foo" --)
208
- 1 | "bar"
209
- 2 | ""
210
- */
211
-
212
- auto selector =
213
- LinearSelection (selectionHelper, CellLocation { LineOffset (-2 ), ColumnOffset (8 ) }, []() {});
214
- (void ) selector.extend (CellLocation { LineOffset (0 ), ColumnOffset (1 ) });
215
- selector.complete ();
216
-
217
- vector<Selection::Range> const selection = selector.ranges ();
218
- REQUIRE (selection.size () == 3 );
219
-
220
- Selection::Range const & r1 = selection[0 ];
221
- CHECK (r1.line == LineOffset (-2 ));
222
- CHECK (r1.fromColumn == ColumnOffset (8 ));
223
- CHECK (r1.toColumn == ColumnOffset (10 ));
224
- CHECK (r1.length () == ColumnCount (3 ));
225
-
226
- Selection::Range const & r2 = selection[1 ];
227
- CHECK (r2.line == LineOffset (-1 ));
228
- CHECK (r2.fromColumn == ColumnOffset (0 ));
229
- CHECK (r2.toColumn == ColumnOffset (10 ));
230
- CHECK (r2.length () == ColumnCount (11 ));
231
-
232
- Selection::Range const & r3 = selection[2 ];
233
- CHECK (r3.line == LineOffset (0 ));
234
- CHECK (r3.fromColumn == ColumnOffset (0 ));
235
- CHECK (r3.toColumn == ColumnOffset (1 ));
236
- CHECK (r3.length () == ColumnCount (2 ));
237
-
238
- auto selectedText = TextSelection { screen };
239
- renderSelection (selector, selectedText);
240
- CHECK (selectedText.text == " ,hi\n 12345,67890\n fo" );
241
- }
200
+ // SECTION("multiple lines from history into main buffer")
201
+ // {
202
+ // term.writeToScreen("foo\r\nbar\r\n"); // move first two lines into history.
203
+ // /*
204
+ // -3 | "12345,67890"
205
+ // -2 | "ab,cdefg,hi" (--
206
+ // -1 | "12345,67890" -----------
207
+ // 0 | "foo" --)
208
+ // 1 | "bar"
209
+ // 2 | ""
210
+ // */
211
+ //
212
+ // auto selector =
213
+ // LinearSelection(selectionHelper, CellLocation { LineOffset(-2), ColumnOffset(8) }, []() {});
214
+ // (void) selector.extend(CellLocation { LineOffset(0), ColumnOffset(1) });
215
+ // selector.complete();
216
+ //
217
+ // vector<Selection::Range> const selection = selector.ranges();
218
+ // REQUIRE(selection.size() == 3);
219
+ //
220
+ // Selection::Range const& r1 = selection[0];
221
+ // CHECK(r1.line == LineOffset(-2));
222
+ // CHECK(r1.fromColumn == ColumnOffset(8));
223
+ // CHECK(r1.toColumn == ColumnOffset(10));
224
+ // CHECK(r1.length() == ColumnCount(3));
225
+ //
226
+ // Selection::Range const& r2 = selection[1];
227
+ // CHECK(r2.line == LineOffset(-1));
228
+ // CHECK(r2.fromColumn == ColumnOffset(0));
229
+ // CHECK(r2.toColumn == ColumnOffset(10));
230
+ // CHECK(r2.length() == ColumnCount(11));
231
+ //
232
+ // Selection::Range const& r3 = selection[2];
233
+ // CHECK(r3.line == LineOffset(0));
234
+ // CHECK(r3.fromColumn == ColumnOffset(0));
235
+ // CHECK(r3.toColumn == ColumnOffset(1));
236
+ // CHECK(r3.length() == ColumnCount(2));
237
+ //
238
+ // auto selectedText = TextSelection { screen };
239
+ // renderSelection(selector, selectedText);
240
+ // CHECK(selectedText.text == ",hi\n12345,67890\nfo");
241
+ // }
242
242
}
243
243
244
244
TEST_CASE (" Selector.LinearWordWise" , " [selector]" )
0 commit comments