@@ -244,19 +244,17 @@ class EditlineTestFixture : public ::testing::Test {
244
244
EditlineAdapter _el_adapter;
245
245
std::shared_ptr<std::thread> _sp_output_thread;
246
246
247
- protected:
248
- bool _has_term = true ;
249
-
250
247
public:
251
248
void SetUp () {
252
249
FileSystem::Initialize ();
253
250
254
251
// We need a TERM set properly for editline to work as expected.
255
- if (setenv (" TERM" , " vt100" , 1 ) != 0 )
256
- _has_term = false ;
252
+ setenv (" TERM" , " vt100" , 1 );
257
253
258
254
// Validate the editline adapter.
259
255
EXPECT_TRUE (_el_adapter.IsValid ());
256
+ if (!_el_adapter.IsValid ())
257
+ return ;
260
258
261
259
// Dump output.
262
260
_sp_output_thread =
@@ -275,10 +273,6 @@ class EditlineTestFixture : public ::testing::Test {
275
273
};
276
274
277
275
TEST_F (EditlineTestFixture, EditlineReceivesSingleLineText) {
278
- // Skip if we don't have a TERM.
279
- if (!_has_term)
280
- return ;
281
-
282
276
// Send it some text via our virtual keyboard.
283
277
const std::string input_text (" Hello, world" );
284
278
EXPECT_TRUE (GetEditlineAdapter ().SendLine (input_text));
@@ -295,10 +289,6 @@ TEST_F(EditlineTestFixture, EditlineReceivesSingleLineText) {
295
289
}
296
290
297
291
TEST_F (EditlineTestFixture, EditlineReceivesMultiLineText) {
298
- // Skip if we don't have a TERM.
299
- if (!_has_term)
300
- return ;
301
-
302
292
// Send it some text via our virtual keyboard.
303
293
std::vector<std::string> input_lines;
304
294
input_lines.push_back (" int foo()" );
0 commit comments